Uptime plugin (reboot monitor)
Moderators: Developers, Moderators
Uptime plugin (reboot monitor)
08/04/2008
http://gilles.boulon.free.fr/uptime/uptime-0.4.zip
Obsolete :
http://gilles.boulon.free.fr/uptime/uptime-0.3.rar
like suggesting by torstentfk, i think that Cacti must checks the uptime of
devices, and signal if the device has rebooted.
originals posts :
http://forums.cacti.net/about6508-0-asc-495.html
http://cactiusers.org/forums/topic253.html
so i have done this plugin, using thold and working with cactid
1. decompress plugin in <cacti base dir>\plugins\uptime
2. install plugin (see plugin architecture documentation)
3. optionnaly, use patched host.php (ONLY with Plugin Architecture 0.9)
(this file is only here to add fonctionnality to Uptime and Monitor plugins)
TODO :
i don't need them but all features i want to include are already in thold :
- weekend or hours exception (because my windows servers are rebooted the weekend...)
- global or extra notify...
NB :
for hours exception in thold, see this :
http://cactiusers.org/forums/viewtopic.php?p=1224#1224
http://gilles.boulon.free.fr/uptime/uptime-0.4.zip
Obsolete :
http://gilles.boulon.free.fr/uptime/uptime-0.3.rar
like suggesting by torstentfk, i think that Cacti must checks the uptime of
devices, and signal if the device has rebooted.
originals posts :
http://forums.cacti.net/about6508-0-asc-495.html
http://cactiusers.org/forums/topic253.html
so i have done this plugin, using thold and working with cactid
1. decompress plugin in <cacti base dir>\plugins\uptime
2. install plugin (see plugin architecture documentation)
3. optionnaly, use patched host.php (ONLY with Plugin Architecture 0.9)
(this file is only here to add fonctionnality to Uptime and Monitor plugins)
TODO :
i don't need them but all features i want to include are already in thold :
- weekend or hours exception (because my windows servers are rebooted the weekend...)
- global or extra notify...
NB :
for hours exception in thold, see this :
http://cactiusers.org/forums/viewtopic.php?p=1224#1224
- Attachments
-
- auth
- auth.png (9.72 KiB) Viewed 63179 times
-
- uptime1
- uptime2.png (31.02 KiB) Viewed 63178 times
-
- hosts
- host.png (29.8 KiB) Viewed 63578 times
-
- devices
- devices.png (12.31 KiB) Viewed 63579 times
Last edited by gilles on Tue Apr 08, 2008 2:51 pm, edited 6 times in total.
gilles,
Great plugin!
I have just a little suggestion...
Change the line:to:
Thanks in advance!
(...and sorry for my poor English!)
Great plugin!
I have just a little suggestion...
Change the line:
Code: Select all
print round(($q_row["uptime"])/8640000, 1) . "d " . (($q_row["uptime"])%8640000)/360000) . "h";
Code: Select all
$days=floor(($q_row["uptime"]/8640000));
$hours=floor((($q_row["uptime"]%8640000)/360000));
$minutes=floor(((($q_row["uptime"]%8640000)%360000)/6000));
print $days . "d " . $hours . "h " . $minutes ."m";
(...and sorry for my poor English!)
Thanks in advance!
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
gilles,
I just received +1300 e-mails with the subject "Reboot detected of host:..." from all my hosts that are "Disabled" or "Down"!!!
There is any way to correct this?!
I think that the Uptime plugin should send e-amil only when a reboot is detected in a host, and not when a host is down or when it is disabled!
Thanks in advance!
(...and sorry for my poor English!)
I just received +1300 e-mails with the subject "Reboot detected of host:..." from all my hosts that are "Disabled" or "Down"!!!
There is any way to correct this?!
I think that the Uptime plugin should send e-amil only when a reboot is detected in a host, and not when a host is down or when it is disabled!
Thanks in advance!
(...and sorry for my poor English!)
Thanks in advance!
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
(And sorry for my poor English...)
_______________________________________
twelzy (Enio Sanches)
I thank you for your message.
Now, it check if host is down or disabled.
I have also resolve a bug for the checkbox "check uptime".
I have updated too "host.php".
I'm going to see a method to clean the table "uptime" when you delete a host.
I have updated the plugin.twelzy wrote: I think that the Uptime plugin should send e-amil only when a reboot is detected in a host, and not when a host is down or when it is disabled!
Now, it check if host is down or disabled.
I have also resolve a bug for the checkbox "check uptime".
I have updated too "host.php".
I'm going to see a method to clean the table "uptime" when you delete a host.
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
Hi,
I am happy that my suggestion is now ready for a plugin.
I change my installation and found some issues:
- the sorting o fthe uptime is not correct.
Please use BIGINT as the type of uptime not strings.
- the sort for Uptime-ASC/DESC does not remove other sorting. everytime i click on Uptime (for resorting) I get different views.
- posibility for mass-change to enable all hosts to check uptime.
(I made this via phpmyadmin)
...Works great!
Torsten
I am happy that my suggestion is now ready for a plugin.
I change my installation and found some issues:
- the sorting o fthe uptime is not correct.
Please use BIGINT as the type of uptime not strings.
- the sort for Uptime-ASC/DESC does not remove other sorting. everytime i click on Uptime (for resorting) I get different views.
- posibility for mass-change to enable all hosts to check uptime.
(I made this via phpmyadmin)
...Works great!
Torsten
I have installed the uptime plugin and it is working as I see the uptime on the devices page, but when I go to the "Uptime" tab, none of the systems that I have chosen to be monitored are listed? I noticed in your images that you have an option to monitor uptime in the drop down menu that I do not have (I have the checkbox on the individual devices page). Am I missing a step somewhere or would this be a part of the patched host file that is included? thanks.
***EDIT*** Sorry, just used the patched host.php file and it does add the uptime option to the drop down menu and also just realized that the "Uptime" tab lists last reboot and since none of my systems have been rebooted, probably explains why there is no data there.
***EDIT*** Sorry, just used the patched host.php file and it does add the uptime option to the drop down menu and also just realized that the "Uptime" tab lists last reboot and since none of my systems have been rebooted, probably explains why there is no data there.
-
- Cacti User
- Posts: 83
- Joined: Fri Aug 22, 2003 4:33 am
might be install problem
Its not showing any thing on the devices page....do i need to install the .sql file with the command mysql -p cacti < uptime.sql.....provided in the rar file....its showing N/A....but i have snmp enabled on all the devices....
Chetan Jain.
Chetan Jain.
problem uptime
I received 100 e-mails with the subject "Reboot detected of host:..." everyday
Directory: uptime
Version: 0.3
Author: Gilles Boulon
Home Page: http://forums.cacti.net/viewtopic.php?t=13510
Please help me
Directory: uptime
Version: 0.3
Author: Gilles Boulon
Home Page: http://forums.cacti.net/viewtopic.php?t=13510
Please help me
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
Hi,
the reboot-monitor alert if the device is more than 497 days up, Mail:
"Host : xxxxx, old uptime was : 4294951006 (497.1d), new is : 13353 (0d)"
(The snmp-variable only stores 32bit of ticks=497 days)
It would be nice, if the plugin checks the old uptime and if it detects a reboot it should check also the uptime beeing between 497 and 498 days. If it is so there should be no alarm.
Torsten
the reboot-monitor alert if the device is more than 497 days up, Mail:
"Host : xxxxx, old uptime was : 4294951006 (497.1d), new is : 13353 (0d)"
(The snmp-variable only stores 32bit of ticks=497 days)
It would be nice, if the plugin checks the old uptime and if it detects a reboot it should check also the uptime beeing between 497 and 498 days. If it is so there should be no alarm.
Torsten
Great Tool.. feature suggestion
Great plugin work !!
This has been working very well in our case, I would like to offer a feature suggestion. Our network has many technicians for many different circuts. We monitor links for other companies as well.. I would like to be able to send individual notices for each device to only certain technicians. For example, reboots should notify:
device1 : tech1@host.com, admin@network.com
device2 : tech2@othercompany.com, admin@othercompany.com
Is that something that can be coded into the plugin?
Thanks !!
This has been working very well in our case, I would like to offer a feature suggestion. Our network has many technicians for many different circuts. We monitor links for other companies as well.. I would like to be able to send individual notices for each device to only certain technicians. For example, reboots should notify:
device1 : tech1@host.com, admin@network.com
device2 : tech2@othercompany.com, admin@othercompany.com
Is that something that can be coded into the plugin?
Thanks !!
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
Found time to change it: file "check-uptime"torstentfk wrote:Hi,
the reboot-monitor alert if the device is more than 497 days up, Mail:
"Host : xxxxx, old uptime was : 4294951006 (497.1d), new is : 13353 (0d)"
(The snmp-variable only stores 32bit of ticks=497 days)
It would be nice, if the plugin checks the old uptime and if it detects a reboot it should check also the uptime beeing between 497 and 498 days. If it is so there should be no alarm.
Torsten
Insert before last if-Statement: if (($old_uptime<4294937286) || ($old_uptime>4294967297)) {
insert after befor last 3rd } another }to close the new if-statement
Also changed the thold_mail - function call:
thold_mail($global_alert_address, '', 'Reboot detected at' . $reboot_date . ' of host : ' . $q_row........
Torsten
Last edited by torstentfk on Tue Jul 11, 2006 2:52 am, edited 1 time in total.
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
Hello developer,
found a bug for computing the uptime at host.php. The floor function could not read BIGINT or it does not run with very big numbers.
I changed this:
I use the host.php version where I can sort the columns by clicking in the headers. Please check this and incoorperate it in the future versions.
Torsten
found a bug for computing the uptime at host.php. The floor function could not read BIGINT or it does not run with very big numbers.
I changed this:
Code: Select all
# diff host.new host.php
835,836c835
< $sql_where =" ON host.id=uptime.id ";
< $sql_where .= "where (host.hostname like '%%" . $_REQUEST["filter"] . "%%' OR host.description like '%%" . $_REQUEST["filter"] . "%%')";
---
> $sql_where = "where (host.hostname like '%%" . $_REQUEST["filter"] . "%%' OR host.description like '%%" . $_REQUEST["filter"] . "%%')";
852a852
>
857c857
< from host LEFT JOIN uptime
---
> from host
870,872c870,871
< host.availability,
< uptime.uptime
< FROM host LEFT JOIN uptime
---
> host.availability
> FROM host
909c908
< "avg_time" => array("Average (ms)", "DESC"),
---
> "avg_time" => array("Average (ms>", "DESC"),
940,942c939,942
< $days=floor($q_row["uptime"]/8640000); $r=$q_row["uptime"]-$days*8640000;
< $hours=floor( $r/360000 ); $r=$q_row["uptime"]-$days*8640000-$hours*360000;
< $minutes=floor($r/6000);
---
>
> $days=floor(($q_row["uptime"]/8640000));
> $hours=floor((($q_row["uptime"]%8640000)/360000));
> $hours=floor((($q_row["uptime"]%8640000)/360000));
> $minutes=floor(((($q_row["uptime"]%8640000)%360000)/6000));
Torsten
Re: Uptime plugin (reboot monitor)
This looks like an awesome patch. I am having troubles getting it to install. I have decompressed the files but am not sure how to install it. Can someone help?gilles wrote:so i have done this plugin, using thold and working with cactid
1. decompress plugin in <cacti base dir>\plugins\uptime
2. install plugin (see plugin architecture documentation)
3. optionnaly, use patched host.php (ONLY with Plugin Architecture 0.9)
(this file is only here to add fonctionnality to Uptime and Monitor plugins)
Thanks,
Mike
Who is online
Users browsing this forum: No registered users and 0 guests