Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan Agent not updating alive status #61

Open
mavoni2701 opened this issue Jan 30, 2020 · 15 comments
Open

Scan Agent not updating alive status #61

mavoni2701 opened this issue Jan 30, 2020 · 15 comments

Comments

@mavoni2701
Copy link

HI there,

first off: The agent is set properly, has all needed rights in the Database and all prerequisites are installed. When the index.php file is executed with discover argument, it also writes entries into the database.
The agent sits in another vlan as the main phpipam server.

When executing the index.php with update as argument, the ip is shown as offline. Pingable from the agent host, due to network infrastructure not pinagble over the ipam server host.

How do we fix that?

@Haringstad
Copy link

I just now, have the same issue. Discover works fine, but update, no avail.

@mavoni2701
Copy link
Author

Hi again,

just found out that the "Host Alive" check is performed by the phpIPAM server itself, so the agent only scans for new hosts/ updates the subnet.

Currently working on a solution for that, means a php based script which resolves the hostnames from the remote subnet and also updating the alive status.

@Haringstad
Copy link

Hi again,

just found out that the "Host Alive" check is performed by the phpIPAM server itself, so the agent only scans for new hosts/ updates the subnet.

Currently working on a solution for that, means a php based script which resolves the hostnames from the remote subnet and also updating the alive status.

Did you get any progress on this?

@Kendzione
Copy link

Hello, there is a duplicate thread, #64

I have the same problem, Host status is not updated in phpipam, all host in subnets assigned to remote agent are "red"
when I run
php /root/phpipam-agent/index.php update
on remote agent mahine I ge correct output in console, I see ip list and orrect icmp response status,
however this data seems not to be pushed into phpipam database,
Host status update is not working with remote scan agent,
Discovery scan works fine.

Can you help me take actions to resolve issue?
How it works, and where to start reviewing code,
Is there any debug output to analyze at phpipam server side?

@Kendzione
Copy link

Hello, there is a duplicate thread, #64

I have the same problem, Host status is not updated in phpipam, all host in subnets assigned to remote agent are "red"
when I run
php /root/phpipam-agent/index.php update
on remote agent mahine I ge correct output in console, I see ip list and orrect icmp response status,
however this data seems not to be pushed into phpipam database,
Host status update is not working with remote scan agent,
Discovery scan works fine.

Can you help me take actions to resolve issue?
How it works, and where to start reviewing code,
Is there any debug output to analyze at phpipam server side?

I have resolved issue, :

There is need to set correct timezone for scan agent remote host in php.ini

you can find php ini with command:
php -i | grep "Loaded Configuration File"

change parameter "date.timezone: in php.ini to match your timezone
example:
date.timezone = Europe/Warsaw

@pmehrken
Copy link

I am having the same issue. I have tried your fix of setting the date.timezone = America/Chicago, however the Alive status is not being updated.

@paulng30
Copy link

paulng30 commented Feb 9, 2021

Hi,

I am running with version 1.4. I am having the same issue. The agent's date.timezone has been set to its local timezone. However, this problem still persists. Please let us know if anything else we can try to fix this issue.

Thank you!

@tr1a7byf1re
Copy link

Hello,

I have spent the last couple days trying to figure out why running pingCheck.php with a Cron script is not updating the status on IPAM, but running it manually seems to work. I have read through a number of threads that link to: https://phpipam.net/automatic-host-availability-check/ and I noticed that when I copy the sample code in Step 3 there is an extra space after pingCheck.php. When I removed this from my Cron script the Hosts check worked as expected. It appears a lot of users have been reporting similar problems, so maybe this will help them.

@RyanMcKone
Copy link

This still appears to be an issue pervasive in v1.6. Agent scans hosts just fine, time is updated on the main server and shows the correct time that it is run on, per the schedule in cron. "Address is Offline" message still appears, status box is red. Running 'index.php update' manually from the command line doesn't change it either. The time gets updated correctly, but it still thinks the host is offline.
I noticed in the link from @tr1a7byf1re, the command suggested to run in cron is different than is currently referenced in the installation instructions of the main agent repo. Trying to run those files from updated directories fails entirely, seems like they were from an old version; fine.
As suggested previous: date.timezone entries on main ipam server as well as agent are the same timezone, no change. I wasn't sure either that if it were a timezone issue, that the servers need to be able to access whichever area on the internet that translates "America/Toronto" into an NTP address and update their actual local time accordingly, but making them internet accessible didn't help either.
Has anyone figured out any other solutions to this issue?

@NathanAtCrowder
Copy link

Adding the crontab part of this fixed my issue.

https://ithinkvirtual.com/2016/05/08/installing-phpipam-on-ubuntu-16-04/

@rimvydukas
Copy link

Are there any fix for agent not updating discovered hosts status. In my case all hosts are green everytime:/ Hosts status date changes after each index.php update run.

@wcarman1
Copy link

My agent was working on 1.5 but stopped when I upgraded to 1.6. My main server does the update and discovery fine but I have one agent and it updates the "Last check" time as well as the "Last seen" time but all IPs that are scanned with the agent show as red. I can manually run index.php update on the agent and it shows IPs as being reachable but not changing them from red (offline state) to green (online, reachable state).

@wcarman1
Copy link

UPDATE: I figured out my problem- I had to uncomment (remove the ";") and update my timezone
"date.timezone = America/New_York"
Both in /etc/php/8.2/apache2/php.ini and in /etc/php/8.2/cli/php.ini. At first, I just updated cli/php.ini and restarted apache but once I updated apache2/php.ini as well and restarted apache again it started showing the online devices correctly.

What I find odd about this entire this is that in the database it was reflecting that the devices had a state of 2 which from what I gathered means that they are online, so I'm not sure why the timezone has any impact on that at all.

Also just incase it had any impact on the outcome, I did switch from using ping to using pear ping in this process to see if it helped but I don't think that was what fixed it.

@agwgithub
Copy link

UPDATE: I figured out my problem- I had to uncomment (remove the ";") and update my timezone "date.timezone = America/New_York" Both in /etc/php/8.2/apache2/php.ini and in /etc/php/8.2/cli/php.ini. At first, I just updated cli/php.ini and restarted apache but once I updated apache2/php.ini as well and restarted apache again it started showing the online devices correctly.

What I find odd about this entire this is that in the database it was reflecting that the devices had a state of 2 which from what I gathered means that they are online, so I'm not sure why the timezone has any impact on that at all.

Also just incase it had any impact on the outcome, I did switch from using ping to using pear ping in this process to see if it helped but I don't think that was what fixed it.

Thank you @wcarman1 for the tip! I just upgraded the php on our centos server and had to edit the /etc/opt/remi/php83/php.ini file which fixed the problem.

@jasonboche
Copy link

jasonboche commented Aug 18, 2024

UPDATE: I figured out my problem- I had to uncomment (remove the ";") and update my timezone "date.timezone = America/New_York" Both in /etc/php/8.2/apache2/php.ini and in /etc/php/8.2/cli/php.ini. At first, I just updated cli/php.ini and restarted apache but once I updated apache2/php.ini as well and restarted apache again it started showing the online devices correctly.

What I find odd about this entire this is that in the database it was reflecting that the devices had a state of 2 which from what I gathered means that they are online, so I'm not sure why the timezone has any impact on that at all.

Also just incase it had any impact on the outcome, I did switch from using ping to using pear ping in this process to see if it helped but I don't think that was what fixed it.

Thank you @wcarman1. I've just started playing around with phpipam v1.7.0 on Ubuntu Server 24.04 LTS and ran into the issue where ip addresses once discovered are not being automatically scanned afterwards and after a few hours or a day all of the bubbles go from green to red. Just like you had figured out and documented:

date.timezone = America/Chicago

needs to be configured in two locations:
/etc/php/8.3/apache2/php.ini
/etc/php/8.3/cli/php.ini

Then restart Apache: sudo /etc/init.d/apache2 restart

In addition, cron jobs need to be added for the periodic rescans. I'm not sure why this is not working out of the box in v1.7.0. Maybe it has something to do with me running this on Ubuntu.

crontab -e
#https://ithinkvirtual.com/2016/05/08/installing-phpipam-on-ubuntu-16-04/
*/15 * * * * /usr/bin/php -c /etc/php/8.3/cli/php.ini /var/www/html/phpipam/functions/scripts/pingCheck.php

*/15 * * * * /usr/bin/php -c /etc/php/8.3/cli/php.ini /var/www/html/phpipam/functions/scripts/resolveIPaddresses.php

*/15 * * * * /usr/bin/php -c /etc/php/8.3/cli/php.ini /var/www/html/phpipam/functions/scripts/discoveryCheck.php

Thank you kindly,
Jas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests