Home > HowTo, Nagios > Cannot get perfdata file. Unkown perfdata file

Cannot get perfdata file. Unkown perfdata file

November 27th, 2009 Leave a comment Go to comments

Using Nagios / Centreon  Distributed Monitoring
Problem:

#  tail -f /usr/local/centreon/log/centcore.log
“Cannot get perfdata file. Unkown perfdata file on poller 2”

and
# tail /usr/local/centreon/log/nagiosPerfTrace.log

“Use of uninitialized value in concatenation (.) or string at /usr/local/centreon/bin/nagiosPerfTrace line 346.
DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 at /usr/local/centreon/bin/nagiosPerfTrace line 289.”

I can also see that the rrd are created and permissions looks ok here:
# ll /var/lib/centreon/nagios-perf/
drwxrwxr-x 2 nagios nagios 4096 Nov 18 11:00 perfmon-1
drwxrwxr-x 2 nagios nagios 4096 Nov 24 17:55 perfmon-2
The perfmon-1 seems not to be updating….

The code that reports the error is inside /usr/local/centreon/bin/centcore:

sub getPerfDataFile($$){
my ($filename, $sth2, $data, $con, $poller_id);
$con = $_[0];
$poller_id = $_[1];

# Create request
my $request = “SELECT `nagios_perfdata` FROM `nagios_server` WHERE `id` = ‘”.$poller_id.”‘”;
$sth2 = $con->prepare($request);
if (!$sth2->execute()) {
writeLogFile(“Error when getting perfdata file : ” . $sth2->errstr . “”);
undef($request);
return “”;
}
$data = $sth2->fetchrow_hashref();
$filename = $data->{‘nagios_perfdata’};

I saw inside the DB centreon, that it was not defiened in nagios_perfdata.

Solution:

Configuration > Centreon > Poller (select your remote)

Add the value  /usr/local/nagios/var/service-perfdata to Perfdata file

Restart both nagios and  Now eveything is back to normal!

More info on Distributed Monitoring

VAMOVE *

*