Manage: same uptime is reboot!?!?

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Manage: same uptime is reboot!?!?

Post by torstentfk »

Hello,

I get this alert email:

Code: Select all

Host is DOWN


Manage global status : down (uptime 2048305139 -> 2048305139)

Cacti host id : 72
As you can see the uptimes are the same.
Which php file must I change to remove this alert? (making a ">" from a "=" )

Torsten
lankienen
Cacti User
Posts: 60
Joined: Fri Feb 06, 2009 3:15 am
Location: Dublin

Post by lankienen »

Hi torsten,

I know this is not an answer for your question but
i need to contact you anyway because i have a similar wierd uptime problem with my devices.

The 497.1d uptime bug:

i used your code in check-uptime.php but yesterday i received the error again :-/

error alert messages:

Code: Select all

Host : ip-address (hostname), old uptime was : 4294935195 (497.1d), new is : 9528 (0d)
Host : ip-address (hostname), Old uptime was : 4294953448 (497.1d) New is : 16238 (0d) Reason:

Code: Select all

if (($old_uptime<4294937286) || ($old_uptime>4294967295)) 
    { 
        if ($new_uptime < $old_uptime) { 
            cacti_log("Reboot detected of host : " . $q_row["hostname"] , true, "UPTIME"); 
            $today = getdate(); 
            $reboot_date = $today['year']."-".$today['mon']."-".$today['mday']." ".$today['hours'].":".$today['minutes'].":".$today['seconds']; 
            db_execute("insert into uptime_data ( id , datetime, extra ) values ( '" . $q_row["id"] . "' , '" . $reboot_date . "' , '' ) "); 
            thold_mail($global_alert_address, '', 'Reboot detected at ' . $reboot_date . ' of host : ' . $q_row["hostname"], 'Host : ' . $q_row["hostname"] . ' (' . $q_row["description"] . '), old uptime was : ' . $old_uptime . ' (' . round(($old_uptime)/8640000, 1) . 'd), new is : ' . $new_uptime . ' (' . round(($new_uptime)/8640000, 1) . 'd)', ''); 
         } 
         else {$new_uptime = $new_uptime ;}  
    } 
    else 
       {cacti_log("Near on SNMP-overflow of host : " . $q_row["hostname"] , true, "UPTIME"); } 
  } 
  
} 

          
?>
Can you help me out with to fix this issue please?

btw. i think this
Manage global status : down (uptime 2048305139 -> 2048305139)
depends also only from check-uptime.php.

Mybe the developer can give us a clue?


Thanks
lankienen
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Re: Manage: same uptime is reboot!?!?

Post by gilles »

torstentfk wrote:Hello,

I get this alert email:

Code: Select all

Host is DOWN


Manage global status : down (uptime 2048305139 -> 2048305139)

Cacti host id : 72
As you can see the uptimes are the same.
Which php file must I change to remove this alert? (making a ">" from a "=" )

Torsten
the host was down, this is why you receive a down message
last and current uptime are informational
changing this will not remove the alert
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

lankienen wrote:Hi torsten,

I know this is not an answer for your question but
i need to contact you anyway because i have a similar wierd uptime problem with my devices.

The 497.1d uptime bug:

i used your code in check-uptime.php but yesterday i received the error again :-/

error alert messages:

Code: Select all

Host : ip-address (hostname), old uptime was : 4294935195 (497.1d), new is : 9528 (0d)
Host : ip-address (hostname), Old uptime was : 4294953448 (497.1d) New is : 16238 (0d) Reason:

Code: Select all

if (($old_uptime<4294937286) || ($old_uptime>4294967295)) 
    { 
        if ($new_uptime < $old_uptime) { 
            cacti_log("Reboot detected of host : " . $q_row["hostname"] , true, "UPTIME"); 
            $today = getdate(); 
            $reboot_date = $today['year']."-".$today['mon']."-".$today['mday']." ".$today['hours'].":".$today['minutes'].":".$today['seconds']; 
            db_execute("insert into uptime_data ( id , datetime, extra ) values ( '" . $q_row["id"] . "' , '" . $reboot_date . "' , '' ) "); 
            thold_mail($global_alert_address, '', 'Reboot detected at ' . $reboot_date . ' of host : ' . $q_row["hostname"], 'Host : ' . $q_row["hostname"] . ' (' . $q_row["description"] . '), old uptime was : ' . $old_uptime . ' (' . round(($old_uptime)/8640000, 1) . 'd), new is : ' . $new_uptime . ' (' . round(($new_uptime)/8640000, 1) . 'd)', ''); 
         } 
         else {$new_uptime = $new_uptime ;}  
    } 
    else 
       {cacti_log("Near on SNMP-overflow of host : " . $q_row["hostname"] , true, "UPTIME"); } 
  } 
  
} 

          
?>
Can you help me out with to fix this issue please?

btw. i think this
Manage global status : down (uptime 2048305139 -> 2048305139)
depends also only from check-uptime.php.

Mybe the developer can give us a clue?


Thanks
lankienen
i don't understand
are you using uptime AND manage plugin ?
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

yes because I want to use the reboot-monitor.Is this obsolet?

I want to get email for a reboot event and a different if a host fails a poll.
I can easily see from the mail header which event occured.
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

if you use manage plugin, go to settings and check "Check system uptime"
this will try to use system uptime and then snmp agent uptime if system uptime is unavailable
if your counter don't change, your device have a snmp problem
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

You don't need both - in the MANAGE alerts, change the alert type to "All"
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

removed by torstentfk - not correct
Last edited by torstentfk on Wed Mar 11, 2009 8:35 am, edited 1 time in total.
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

torstentfk wrote:yes because I want to use the reboot-monitor.Is this obsolet?
yes
torstentfk wrote:I want to get email for a reboot event and a different if a host fails a poll.
I can easily see from the mail header which event occured.
manage can do this
lankienen
Cacti User
Posts: 60
Joined: Fri Feb 06, 2009 3:15 am
Location: Dublin

Post by lankienen »

gilles wrote:
lankienen wrote:Hi torsten,

I know this is not an answer for your question but
i need to contact you anyway because i have a similar wierd uptime problem with my devices.

The 497.1d uptime bug:

i used your code in check-uptime.php but yesterday i received the error again :-/

error alert messages:

Code: Select all

Host : ip-address (hostname), old uptime was : 4294935195 (497.1d), new is : 9528 (0d)
Host : ip-address (hostname), Old uptime was : 4294953448 (497.1d) New is : 16238 (0d) Reason:

Code: Select all

if (($old_uptime<4294937286) || ($old_uptime>4294967295)) 
    { 
        if ($new_uptime < $old_uptime) { 
            cacti_log("Reboot detected of host : " . $q_row["hostname"] , true, "UPTIME"); 
            $today = getdate(); 
            $reboot_date = $today['year']."-".$today['mon']."-".$today['mday']." ".$today['hours'].":".$today['minutes'].":".$today['seconds']; 
            db_execute("insert into uptime_data ( id , datetime, extra ) values ( '" . $q_row["id"] . "' , '" . $reboot_date . "' , '' ) "); 
            thold_mail($global_alert_address, '', 'Reboot detected at ' . $reboot_date . ' of host : ' . $q_row["hostname"], 'Host : ' . $q_row["hostname"] . ' (' . $q_row["description"] . '), old uptime was : ' . $old_uptime . ' (' . round(($old_uptime)/8640000, 1) . 'd), new is : ' . $new_uptime . ' (' . round(($new_uptime)/8640000, 1) . 'd)', ''); 
         } 
         else {$new_uptime = $new_uptime ;}  
    } 
    else 
       {cacti_log("Near on SNMP-overflow of host : " . $q_row["hostname"] , true, "UPTIME"); } 
  } 
  
} 

          
?>
Can you help me out with to fix this issue please?

btw. i think this
Manage global status : down (uptime 2048305139 -> 2048305139)
depends also only from check-uptime.php.

Mybe the developer can give us a clue?


Thanks
lankienen
i don't understand
are you using uptime AND manage plugin ?
I use monitor and uptime plugin
and:
Code:
if (($old_uptime<4294937286) || ($old_uptime>4294967295))

This are only 10 ticks. could be a little bit too small
Yes i noticed that the last 4 digits change.
How much ticks do you prefer ? I cannot interpret this values?
Can you give me an example to try, so i can rollout and test....
torstentfk
Cacti User
Posts: 367
Joined: Tue Apr 05, 2005 9:52 am
Location: Munich, Germany

Post by torstentfk »

lankienen wrote:Hi torsten,

Code: Select all

if (($old_uptime<4294937286) || ($old_uptime>4294967295)) 
lankienen[/quote]

The calculation:

ticks/sec	0,01
1sec	    =             100
1min	    =          6 000
1h	    =       360 000
1day	    =    8 640 000
497 days	4294080000
---------------------------
 + 2 hour	4294800000
 + 27min	4294962000
 +53sec	4294967300   >>> now we have an overflow
------------------
rest	-4 ticks

so best would be to subtract from 2^32  = 4294967296
 5 minutes minus some ticks: 30 000 ticks :  set it to   4294937296

Torsten
lankienen
Cacti User
Posts: 60
Joined: Fri Feb 06, 2009 3:15 am
Location: Dublin

Post by lankienen »

Thanks a million Thorsten! :wink:
User avatar
GlueGuy
Cacti User
Posts: 255
Joined: Fri Nov 04, 2005 3:37 pm
Location: Ca US
Contact:

Re:

Post by GlueGuy »

gilles wrote:if you use manage plugin, go to settings and check "Check system uptime"
this will try to use system uptime and then snmp agent uptime if system uptime is unavailable
if your counter don't change, your device have a snmp problem
I don't think so. All of the devices I have under manage show valid uptimes via SNMP, but the uptime shown inside manage is either zero, or a static, unchanging number.

I have tried both ways to do uptime inside manage, but it never changes.

So I think there is something else going on.
---------
The Glue Guy
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests