Getting Performance Data into the perfdata files

Cook, Garry GWCOOK at mactec.com
Fri May 21 19:25:28 CEST 2004


Ben Clewett wrote:
> When you configure Nagios, do you get a report like:
> 
>   External Data Routines:
>   ------------------------
>            Peformance data:  File
> 
> In the Nagios install directory, in ./common, there is a file
>   config.h. Can you confirm it contain the line:
> 
> #define USE_XPDFILE 1

Yes, I remember seeing this in the report when I configured the Nagios
binary, and config.status shows that I requested that it be compiled
that way:
   exec ${CONFIG_SHELL-/bin/sh} ./configure  --disable-statuswrl
--enable-embedded-perl --with-perlcache --with-file-perfdata --no-
create --no-recursion ;;

Also, in common/config.h, I do indeed have the line that you mentioned
above. (Darn, I was hoping that maybe it didn't compile correctly).

> Can you confirm that you are not yet using 'perfparse'?  --
> This will
> truncate the log file to size zero.

That's good to know, as I would probably think that I was seeing the
same error again if I manage to get past it and install PerfParse. But
no, I've not yet gotten that far, haven't even compiled it yet, or setup
the mysql db.

> Permissions again.  Always worth checking.  My files look like:
> 
> -rw-rw-r--    1 nagios   nagios      36742 May 21 17:29 hostperf.log
> -rw-rw-r--    1 nagios   nagios     106238 May 21 17:29
> serviceperf.log 

[garry at netmon1 var]$ ll *perf*
-rw-rw-r--    1 nagios   nagios          0 May 20 16:02 hostperf.log
-rw-rw-r--    1 nagios   nagios          0 May 20 16:02 serviceperf.log

Permissions look the same, although the files have not been touched
since I created them yesterday afternoon.

> Apart from that, I'll have to think on it...
> 
> Ben

OK, I'll keep poking and prodding. Anyone know how I would go about
seeing if check_load is actually populating the $PERFDATA$ macro when
run from Nagios? I've already shown it to work from the command line. I
recompiled with DEBUG5 enabled, and then watched the log and forced a
check again:

[1085160061] EXTERNAL COMMAND:
SCHEDULE_FORCED_SVC_CHECK;netmon1;LOAD;1085160058
[1085160070] SERVICE ALERT: netmon1;LOAD;OK;HARD;1;OK - load average:
2.83, 1.71, 1.38

I don't see Performance Data in the log. Should I see it there, or is
this proof that $PERFDATA$ is empty?

> Cook, Garry wrote:
> 
>> Ben Clewett wrote:
>> 
>>> If you manually enter a check command, does it display the
>>> performance data.  Eg:
>> 
>> 
>> Yes.
>> 
>> 
>>> Find one which you know works and ensure Nagios is checking
>>> it.  Note:-
>>> The check_load I used for that web site came from
>>> nagios-plugins-HEAD-200403290547.tar.gz, which image are you using?
>> 
>> 
>> I used check_load from
> nagios-plugins-HEAD-200405201647.tar.gz. It works
>> fine from the command line, performance data after the pipe and all.
>> 
>> [garry at netmon1 libexec]$ ./check_load -w 3,3,3 -c 5,5,5
>> OK - load average: 0.08, 0.83,
>> 1.06|load1=0.080000;3.000000;5.000000;0.000000
>> load5=0.830000;3.000000;5.000000;0.000000
>> load15=1.060000;3.000000;5.000000;0.000000
>> 
>> 
>>> My own nagios.cfg config file shows:
>>> 
>>> process_performance_data=1
>>> xpdfile_host_perfdata_file=/usr/local/nagios/var/hostperf.log
>>> xpdfile_host_perfdata_template=$TIMET$\t$HOSTNAME$\t$OUTPUT$\t
>>> $PERFDATA$
>>> xpdfile_service_perfdata_file=/usr/local/nagios/var/serviceperf.log
>>> xpdfile_service_perfdata_template=$TIMET$\t$HOSTNAME$\t$SERVIC
>>> EDESC$\t$OUTPUT$\t$PERFDATA$  
>>> 
>>> Do you have something similar?
>> 
>> 
>> I have *exactly* the same entries in nagios.cfg.
>> 
>> 
>>> Finally, the log file.  Please look at the log file (tail -f
>>> var/nagios.log) and ensure there are no errors.
>> 
>> 
>> I tail-followed the nagios.log, and forced a check_load on the box.
>> The only thing that showed up in the log was the forced check, no
>> errors. The forced check returned an OK state to Nagios, but still
>> nothing in the perfdata files. 
>> 
>> As the tree said to the lumberjack, I'm stumped.
>> 
>> 
>>> Cook, Garry wrote:
>>> 
>>> 
>>>> I've sent this question to the PerfParse users list, but I don't
>>>> think that there are too many people on the list yet. Also, while I
>>>> want to use PerfParse to display my performance data, this is
>>>> really a Nagios question, as I have not yet reached the PerfParse
>>>> portion of the setup. 
>>>> 
>>>> I've recompiled Nagios 1.2 with performance data (file-based)
>>>> enabled, and I then installed the plugins from yesterday's CVS head
>>>> (which broke check_nagios, had to copy over my old one). I added
>>>> the necessary directives to the main configuration file, as
>>>> described in the Nagios Performance Data docs. For some reason,
>>>> I'm still not getting anything in the perfdata logs.
>>>> 
>>>> Owner/Group and permissions are correct on the perfdata logs. At
>>>> least I think that they are, they are the same as all of the other
>>>> logs in nagios/var. 
>>>> 
>>>> I thought that it could be that I'm just not using any of the
>>>> plugins that utilize performance data. But since check_load is
>>>> shown being graphed on the PerfParse webpage, I enabled it, ran it
>>>> from the command line to verify that it returned perfdata, and
>>>> then added it to Nagios. Still nothing. 
>>>> 
>>>> Any ideas?
>>>> 
>>>> Garry W. Cook, CCNA
>>>> Network Infrastructure Manager
>>>> MACTEC, Inc. - http://www.mactec.com/
>>>> 303.308.6228 (Office) - 720.220.1862 (Mobile)


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id66&op=click
_______________________________________________
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