Title: [opsview] [11608] Don't report the amount of uptime in cascade mode.
Revision
11608
Author
pknight
Date
2013-02-26 18:01:26 +0000 (Tue, 26 Feb 2013)

Log Message

Don't report the amount of uptime in cascade mode.

Modified Paths


Modified: trunk/opsview-core/nagios-plugins/check_snmp_uptime
===================================================================
--- trunk/opsview-core/nagios-plugins/check_snmp_uptime	2013-02-26 17:31:21 UTC (rev 11607)
+++ trunk/opsview-core/nagios-plugins/check_snmp_uptime	2013-02-26 18:01:26 UTC (rev 11608)
@@ -93,7 +93,7 @@
             command => 'PROCESS_SERVICE_CHECK_RESULT',
             args    => join( ';',
                 $np->opts->hosttitle, 'Uptime Restart',
-                '2', 'Uptime reset: ' . nice_ticks($timeticks) ),
+                '2', 'Uptime reset' ),
         );
         $cmd->send_to_master;
     }
@@ -223,47 +223,3 @@
     print $statusfile_fh "$cur_uptime,$rolled_over_flag\n";
     close $statusfile_fh;
 }
-
-# Returns a human readable length of time string for timeticks.
-sub nice_ticks {
-    my $ticks = shift;
-
-    my @time_parts;
-    my $ticks_in_a_second = 100;
-    my $ticks_in_a_minute = $ticks_in_a_second * 60;
-    my $ticks_in_an_hour  = $ticks_in_a_minute * 60;
-    my $ticks_in_a_day    = $ticks_in_an_hour * 24;
-
-    if ( $ticks >= $ticks_in_a_day ) {
-        my $total_days = $ticks / 100 / 60 / 60 / 24;
-        my $rounded_days = sprintf( '%d', $total_days );
-        push @time_parts,
-          $rounded_days . ( $rounded_days > 1 ? ' days' : ' day' );
-        $ticks -= ( $rounded_days * $ticks_in_a_day );
-    }
-
-    if ( $ticks >= $ticks_in_an_hour ) {
-        my $total_hours = $ticks / 100 / 60 / 60;
-        my $rounded_hours = sprintf( '%d', $total_hours );
-        push @time_parts,
-          $rounded_hours . ( $rounded_hours > 1 ? ' hours' : 'hour' );
-        $ticks -= ( $rounded_hours * $ticks_in_an_hour );
-    }
-
-    if ( $ticks >= $ticks_in_a_minute ) {
-        my $total_minutes = $ticks / 100 / 60;
-        my $rounded_minutes = sprintf( '%d', $total_minutes );
-        push @time_parts,
-          $rounded_minutes . ( $rounded_minutes > 1 ? ' minutes' : ' minute' );
-        $ticks -= ( $rounded_minutes * $ticks_in_a_minute );
-    }
-
-    if ( $ticks >= $ticks_in_a_second ) {
-        my $total_seconds = $ticks / 100;
-        my $rounded_seconds = sprintf( '%d', $total_seconds );
-        push @time_parts,
-          $rounded_seconds . ( $rounded_seconds > 1 ? ' seconds' : ' second' );
-    }
-
-    return join( ', ', @time_parts );
-}

_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to