check_nagios give a failure

Claus Rosenberger Claus.Rosenberger at rocnet.de
Fri Jul 18 14:30:19 CEST 2003


In the new nagios-2.0a1 the format of status.sav has changed (the name of
this file too, from .log -> .sav).

Here a patch if somebody want to use the plugins with 2.0a1.

--- nagios-plugins-200307180514/plugins/check_nagios.c  Tue Apr  8
00:53:48 2003
+++ nagios-plugins-2.0-new/plugins/check_nagios.c       Fri Jul 18
14:27:23 2003
@@ -84,11 +84,14 @@

        /* get the date/time of the last item updated in the log */
        while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) {
-               temp_ptr = strtok (input_buffer, "]");
-               temp_entry_time =
-                       (temp_ptr == NULL) ? 0L : strtoul (temp_ptr + 1,
NULL, 10);
-               if (temp_entry_time > latest_entry_time)
-                       latest_entry_time = temp_entry_time;
+               temp_ptr = strtok (input_buffer, "\0");
+               if(strstr(temp_ptr,"last_update")!=NULL){
+                      
temp_entry_time=strtoul(strchr(temp_ptr,'=')+1,NULL,10);
+                       if (temp_entry_time > latest_entry_time) {
+                               latest_entry_time = temp_entry_time;
+                       }
+               }
        }
        fclose (fp);



claus

> What's /var/log/nagios/status.dat? Isn't it called status.log?
>
>> -----Original Message-----
>> From: Claus Rosenberger [mailto:Claus.Rosenberger at rocnet.de]
>> Sent: Thursday, July 17, 2003 8:28 PM
>> To: nagios-users at lists.sourceforge.net
>> Subject: [Nagios-users] check_nagios give a failure
>>
>>
>> hi,
>>
>> i installed the newest cvs with the newest plugins, i dont know if i
>> should use the head or the others, i tried both of them.
>>
>> after upgrading i can use the cgi's but i cannot use commands
>> with cgi's
>>
>> that command
>>
>> /usr/lib/nagios/plugins/check_nagios -F
>> /var/log/nagios/status.dat -e 5 -C
>> /usr/sbin/nagios
>>
>> output
>>
>> Nagios problem: located 4 processes, status log updated
>> 1058469897 seconds
>> ago
>>
>> it seems like a permission problem but i checked the cgi.cfg and the
>> permissions in /var/log/nagios.
>>
>> any ideas?
>>
>> thx
>>
>> claus
>
>
> This private and confidential e-mail has been sent to you by Egg.
> The Egg group of companies includes Egg Banking plc
> (registered no. 2999842), Egg Financial Products Ltd (registered
> no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
> carries out investment business on behalf of Egg and is regulated
> by the Financial Services Authority.
> Registered in England and Wales. Registered offices: 1 Waterhouse Square,
> 138-142 Holborn, London EC1N 2NA.
> If you are not the intended recipient of this e-mail and have
> received it in error, please notify the sender by replying with
> 'received in error' as the subject and then delete it from your
> mailbox.
>



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list