Remove offline IP Hosts automatically
phpipam open-source IP address management
Brought to you by:
myha
I am wondering if there is a script or if there is going to be a script that basically checks if a host that is using an IP address is no longer online by ICMP pings for a certain abmount of time (24hrs, 12hrs, etc) then automatically remove it from the list and mark that IP address free to use.
Is there any examples? I would not mind in learning it just don't know where to start.
Ryan.
Anonymous
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
I don't agree, since you could have an server in maintenance mode for a couple of days / weeks.
I have created a widget which displays the offline servers older then 10 days. That way I'm in control and able to remove an IP.
i don't agree, Since you could have an server which is in downtime for maintenance.
I have created an widget which shows me the offline servers, which are offline for 10 days.
this way I have the ability to delete them manually.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hi,
Could someone share the widget to display the offline servers ?
Thanks :)
Inactive hosts widget added to 1.3 roadmap.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
I know this is now closed, but I still think there should be an option to automatically delete what is offline.
Perhaps there should be an 'aging' setting, so we can set a timeframe after which we would consider the offline IP to really be dead.
Another option could be, a report (or witdget) of offline addresses with a 'delete' button, and the option to unselect addresses that we want to keep.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
BTW.. love the tool, so thanks for all the hard work!
There is a widget + tool subpage available that shows offline IP addresses in development release for upcoming 1.3.
Deleting is 1 simple sql query,so you can prepare a script.
If lastSeen colum under the ipaddresses table is what the name suggest automatically removing not seen host for the past 120 days should be as simle as this. Please correct me if I'm wrong and note that this is not tested.
SET GLOBAL event_scheduler = ON;
SET @@global.event_scheduler = ON;
SET GLOBAL event_scheduler = 1;
SET @@global.event_scheduler = 1;
CREATE EVENT AutoDeleteOldUnseenIpAddresses
ON SCHEDULE
EVERY 1 DAY
STARTS '2016-09-30 05:30:00' ON COMPLETION PRESERVE ENABLE
DO
DELETE FROM ipaddresses WHERE lastSeen < DATE_SUB(NOW(), INTERVAL 120 DAY)