perlnagiosicinga2

NPCD: ERROR: Executed command exits with return code '255'


After updating modules in cpan pnp4nagios/NPCD started logging the following in my syslog every time the script was called;

NPCD[19673]: ERROR: Executed command exits with return code '255'
NPCD[19673]: ERROR: Command line was '/etc/pnp4nagios/libexec/process_perfdata.pl -n --bulk /var/spool/icinga2/perfdata/host-perfdata.1524923929'

There didn't appear to be any loss in functionality or data and my graphs where populating as expected - but I was being spammed by this.

Running the script from the cli gave this result;

bash-4.1$ /etc/pnp4nagios/libexec/process_perfdata.pl -n --bulk /var/spool/icinga2/perfdata/host-perfdata.1524919009 
tv_interval() 2nd argument should be an array reference at /etc/pnp4nagios/libexec/process_perfdata.pl line 218, <PDFILE> line 111

The only useful google result to that error points at the Time::HiRes module.


Solution

  • It appears that the current version of Time::HiRes was/is the issue. cpan offers Time-HiRes-1.9758 as an update but this appears to be the version causing the issue.

    In order to stop the error I had to downgrade that module by doing the following;

    make clean in the folder of the installed version (Mine was at .cpan/build/Time-HiRes-1.9758) then fetching the specific version from cpan;

    cpan JHI/Time-HiRes-1.9721.tar.gz which installed the older (1.9721) version.

    Restarted npcd and the errors where gone.

    I'm not sure which version of Time-HiRes introduced this error/change in behaviour as I've not been through them and am not 100% certain where the issue may actually lay (npcd/Time-HiRes/somewhere else). Hopefully this points someone else in the right direction.

    From ikegami's comment

    "Even in version 1.9721, the second argument (if provided), must be an array reference. It seems the only change in behaviour is the addition of input validation. process_perfdata.pl is buggy, and newer versions of Time::HiRes let you know it."