[Nagiosplug-devel] [ nagiosplug-Bugs-1296242 ] check_nagios 1.26 (plugins 1.4.2) not working with Nagios 2

SourceForge.net noreply at sourceforge.net
Tue Sep 20 03:37:17 CEST 2005


Bugs item #1296242, was opened at 2005-09-20 11:20
Message generated for change (Comment added) made by tonvoon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1296242&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parsing problem
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Daniel Bimschas (bimschas)
>Assigned to: Ton Voon (tonvoon)
Summary: check_nagios 1.26 (plugins 1.4.2) not working with Nagios 2

Initial Comment:
Hi,

the check_nagios plugin always gets the last_entry_time
wrong when doing checks on NAGIOSHOME/var/status.dat.

I made a little fix, my diff:

65,67c65
<       char tag[] = "created=";
<       char *dummy = NULL;
<
---
>
92,97c90,94
<               temp_ptr = strtok (input_buffer, tag);
<               temp_ptr = strtok (NULL,tag);
<               if (temp_ptr != NULL) {
<                       latest_entry_time = strtoul
(temp_ptr,NULL,10);
<                       break;
<               }
---
>               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;

----------------------------------------------------------------------

>Comment By: Ton Voon (tonvoon)
Date: 2005-09-20 11:36

Message:
Logged In: YES 
user_id=664364

Daniel,

Thanks for the patch. Can you attach a diff -u output please as these 
are easier to parse. Also, could you attach an extract of status.dat 
please (I don't have access to a Nagios 2 version).

Ideally, we want a check_nagios which can read either nagios1 or 
nagios2 format, so if you can provide a patch that can handle both, it 
will definitely go in.

Ton

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1296242&group_id=29880




More information about the Devel mailing list