On 4/16/07, <b class="gmail_sendername">Manish Sapariya</b> <<a href="mailto:manishs@gs-lab.com">manishs@gs-lab.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I ran into same problem, I got it working by changing the insert.pl. I<br>am not sure<br>if my config was wrong or there is something wrong in nagios or nagiosgraph.<br><br>----------------Changed code in insert.pl-------------------
<br># Parse performance data from input<br>#<br>sub parseinput {<br>  my $data = shift;<br>  #debug(5, "INSERT perfdata: $data");<br><br>  #my @d = split( /\|\|/, $data);<br><br>### Note the the split delimiter in below line, No matter what I do to
<br>configure the<br>#nagios, I cannot make it print || in the perfdata. It always separated the<br># fields with tab. Also the index used below had to be adjusted according<br>#to how nagios wrote the performance data file.
<br><br>  my @d = split( /\t/, $data);<br><br>  return ( lastcheck    => $d[1],<br>           hostname     => $d[2],<br>           servicedescr => $d[3],<br>           output       => $d[6],<br>           perfdata     => $d[7],
<br>         );<br>}<br>----------------------------------------------------------------</blockquote><div><br>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:<br><br>service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$<br></div><br>which should actually be:<br>
<br>service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$<br><br>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.<br><br>Thanks again for your response, i hope the above helps your issue out.<br>Michael<br>--<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Weiner, Michael wrote:<br>> Using Nagios 2.8 and I am not sure what I am doing wrong. Been trying to
<br>> squeeze out some perfdata in order to test nagiosgraph and I get Nagios<br>> to create the file, but it remains empty no matter what occurs. Here are<br>> the relevant portions of my nagios.cfg for clarification:
<br>><br>> nagios.cfg:<br>> perfdata_timeout=5<br>> process_performance_data=1<br>> #service_perfdata_command=process-service-perfdata<br>> service_perfdata_file=/var/spool/nagios/perfdata.log<br>> service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$SERVICED
<br>> ESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$<br>> service_perfdata_file_mode=a <-- had this set to w based on a previous<br>> email, but that didn't seem to do anything<br>> service_perfdata_file_processing_interval=30
<br>> service_perfdata_file_processing_command=process-service-perfdata<br>><br>> checkcommands.cfg:<br>> define command{<br>>         command_name            process-service-perfdata<br>>         command_line    /usr/bin/perl
<br>> /usr/share/nagios/nagiosgraph/insert.pl<br>> }<br>><br>> I just can NOT seem to get anything written to the perfdata.log file<br>> although nagios DOES create it upon (re)start.<br>><br>> Any thoughts?
<br>><br>>        Michael Weiner |  Lead Analyst  |  Lerner Research Institute<br>> Cleveland Clinic  |  9500 Euclid Ave.   |  Cleveland, OH 44195  | (216)<br>> 445-6454<br></blockquote></div>