perfdata

Michael Weiner hunter at userfriendly.net
Mon Apr 16 12:43:43 CEST 2007


On 4/16/07, Manish Sapariya <manishs at gs-lab.com> wrote:
>
> Hi,
> I ran into same problem, I got it working by changing the insert.pl. I
> am not sure
> if my config was wrong or there is something wrong in nagios or
> nagiosgraph.
>
> ----------------Changed code in insert.pl-------------------
> # Parse performance data from input
> #
> sub parseinput {
>   my $data = shift;
>   #debug(5, "INSERT perfdata: $data");
>
>   #my @d = split( /\|\|/, $data);
>
> ### Note the the split delimiter in below line, No matter what I do to
> configure the
> #nagios, I cannot make it print || in the perfdata. It always separated
> the
> # fields with tab. Also the index used below had to be adjusted according
> #to how nagios wrote the performance data file.
>
>   my @d = split( /\t/, $data);
>
>   return ( lastcheck    => $d[1],
>            hostname     => $d[2],
>            servicedescr => $d[3],
>            output       => $d[6],
>            perfdata     => $d[7],
>          );
> }
> ----------------------------------------------------------------


Thanks for the response. I modified the insert.pl as stated above but that
still made no difference. If you notice in the nagios.cfg:

service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$

which should actually be:

service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$

might explain why you arent seing || but are seing tabs in your perfdata. My
problem seems to stem from the fact that i cannot get data written to the
perfdata.log file at all, thus the insert.pl fails to parse anything at all.
And i cannot find a reason why this is the case.

Thanks again for your response, i hope the above helps your issue out.
Michael
--

> Weiner, Michael wrote:
> > Using Nagios 2.8 and I am not sure what I am doing wrong. Been trying to
> > squeeze out some perfdata in order to test nagiosgraph and I get Nagios
> > to create the file, but it remains empty no matter what occurs. Here are
> > the relevant portions of my nagios.cfg for clarification:
> >
> > nagios.cfg:
> > perfdata_timeout=5
> > process_performance_data=1
> > #service_perfdata_command=process-service-perfdata
> > service_perfdata_file=/var/spool/nagios/perfdata.log
> > service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICED
> > ESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$
> > service_perfdata_file_mode=a <-- had this set to w based on a previous
> > email, but that didn't seem to do anything
> > service_perfdata_file_processing_interval=30
> > service_perfdata_file_processing_command=process-service-perfdata
> >
> > checkcommands.cfg:
> > define command{
> >         command_name            process-service-perfdata
> >         command_line    /usr/bin/perl
> > /usr/share/nagios/nagiosgraph/insert.pl
> > }
> >
> > I just can NOT seem to get anything written to the perfdata.log file
> > although nagios DOES create it upon (re)start.
> >
> > Any thoughts?
> >
> >        Michael Weiner |  Lead Analyst  |  Lerner Research Institute
> > Cleveland Clinic  |  9500 Euclid Ave.   |  Cleveland, OH 44195  | (216)
> > 445-6454
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070416/3e18b50a/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
-------------- next part --------------
_______________________________________________
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