pnp4nagios Graph Configuration Verification failed

This forum was archived to /woltlab and is now in read-only mode. Please register a new account on our new community platform.

You can create a thread on the new site and link to an archived thread. This archive is available as knowledge base, safe and secured.

More details here.
  • $perl verify_pnp_config -m bulk+npcd -c /usr/local/icinga/etc/icinga.cfg -p /usr/local/pnp4nagios/etc/

    .

    .


    service_perfdata_file_processing_command at verify_pnp_config line 462.

    [CRIT] Command process-service-perfdata-file is not defined



    vim /usr/local/pnp4nagios/etc/nagios.cfg


    #

    # Bulk / NPCD mode

    #


    process_performance_data=1


    # *** the template definition differs from the one in the original nagios.cfg

    #

    service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata

    service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::


    $SERVICEPERFDATA$


    \tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$


    \tSERVICESTATETYPE::


    $SERVICESTATETYPE$

    service_perfdata_file_mode=a

    service_perfdata_file_processing_interval=15

    service_perfdata_file_processing_command=process-service-perfdata-file


    # *** the template definition differs from the one in the original nagios.cfg

    #

    host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata

    host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::


    $HOSTCHECKCOMMAND$


    \tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$

    host_perfdata_file_mode=a

    host_perfdata_file_processing_interval=15

    host_perfdata_file_processing_command=process-host-perfdata-file


    #

    # Module mode

    #

    #event_broker_options=-1 # minimum 4+8=12

    #process_performance_data=1

    #broker_module=/usr/local/pnp4nagios/lib/npcdmod.o config_file=/usr/local/pnp4nagios/etc/npcd.cfg


    ******************************************************************************************


    root@dc1-monitoring:/home/serveradmin# vim /usr/local/nagios/objects/commands.cfg


    ## Bulk with NPCD mode

    define command{

    command_name process-service-perfdata-file

    command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.\$TIMET\$

    }


    define command{

    command_name process-host-perfdata-file

    command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.\$TIMET\$

    }


    #define command{

    # command_name process-service-perfdata-file

    # command_line $USER1$/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/service-perfdata

    #}

    #define command{

    # command_name process-host-perfdata-file

    # command_line $USER1$/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/host-perfdata

    # }

    ********************************************************************************


    vim /usr/local/icinga/etc/objects/commands.cfg



    ## Bulk with NPCD mode


    # 'process-host-perfdata' command definition

    define command{

    command_name process-host-perfdata

    command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t


    $HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out

    }



    # 'process-service-perfdata' command definition

    define command{

    command_name process-service-perfdata

    command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t


    $SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out

    }


    # 'process-host-perfdata' command definition

    #define command{

    #command_name process-host-perfdata

    #command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t


    #$HOSTPERFDATA$$

    #}


    # 'process-service-perfdata' command definition

    #define command{

    #command_name process-service-perfdata

    #command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t


    #$SERVICEEXECUTIONTIME$$

    #}


    define command{

    command_name process-service-perfdata-file

    command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$

    }


    define command{

    command_name process-host-perfdata-file

    command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$

    }

    **************************************************************************************


    vim /usr/local/pnp4nagios/etc/rra.cfg


    # 2880 entries with 1 minute step = 48 hours

    RRA:AVERAGE:0.5:1:2880

    # 2880 entries with 5 minute step = 10 days

    RRA:AVERAGE:0.5:5:2880

    # 4320 entries with 30 minute step = 90 days

    RRA:AVERAGE:0.5:30:4320

    # 5840 entries with 360 minute step = 4 years

    RRA:AVERAGE:0.5:360:5840

    RRA:MAX:0.5:1:2880

    RRA:MAX:0.5:5:2880

    RRA:MAX:0.5:30:4320

    RRA:MAX:0.5:360:5840

    RRA:MIN:0.5:1:2880

    RRA:MIN:0.5:5:2880

    RRA:MIN:0.5:30:4320

    RRA:MIN:0.5:360:5840


    ********************************************************************

  • cat /usr/local/pnp4nagios/etc/npcd.cfg



    # NPCD.cfg - sample configuration file for PNPs NPCD

    #

    # This program is free software; you can redistribute it and/or modify

    # it under the terms of the GNU General Public License as published by

    # the Free Software Foundation; either version 2 of the License, or

    # (at your option) any later version.

    #

    # This program is free software; you can redistribute it and/or modify

    # it under the terms of the GNU General Public License version 2 as

    # published by the Free Software Foundation;

    #

    # You should have received a copy of the GNU General Public License

    # along with this program; if not, write to the Free Software

    # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


    # Privilege Options


    user = nagios

    group = nagios


    #########################

    # #

    # Logging Options #

    # #

    #########################


    # log_type - define if you want your logs to

    # 'syslog' or to a 'file'

    #

    # log_type = <value>

    #


    #log_type = file

    log_type = syslog



    # log_file - define a path to your logfile

    # needed if 'log_type'='file'

    #

    # log_file = </path/to/logpath/filename>

    #


    log_file = /usr/local/pnp4nagios/var/npcd.log



    # max_logfile_size - defines the maximum filesize (bytes)

    # before the logfile will rotated.

    #

    # max_logfile_size = <value> (default 10Mbyte)

    #


    max_logfile_size = 10485760



    # log_level - how much should we log?

    #

    # log_level = <integer value>

    #

    # 0 = No logging - except errors

    # 1 = Small logging - some few more output

    # 2 = More Logging (actual ALL logs)

    # -1 = DEBUG Mode - ALL Logging and slower processing

    #


    log_level = 0


    #########################

    # #

    # NEEDED OPTIONS #

    # #

    #########################


    # perfdata_spool_dir - where we can find the

    # performance data files

    #

    # perfdata_spool_dir = </path/to/directory/>

    #


    perfdata_spool_dir = /usr/local/pnp4nagios/var/spool



    # Execute following command for each found file

    # in 'perfdata_spool_dir'

    #

    # perfdata_file_run_cmd = </path/to/command>

    #

    # Must be executable by user/group from above

    #

    # perfdata_file_run_cmd = </path/to/filename>

    #


    perfdata_file_run_cmd = /usr/local/pnp4nagios/libexec/process_perfdata.pl



    # perfdata_file_run_cmd_args (optional)

    #

    # If you wish, you can apply more arguments to the

    # perfdata_file_run_cmd

    #

    # Hint:

    # NPCD will create a command line like this:

    # '<perfdata_file_run_cmd> <perfdata_file_run_cmd_args> <filename_from_spool_dir>'

    #


    perfdata_file_run_cmd_args = --bulk



    # identify_npcd (optional)

    #

    # If set to one (by default) npcd will append

    # '-n' to the perfdata_file_run_cmd

    #

    # identify_npcd = 0|1 (default: 1)


    identify_npcd = 1



    # npcd_max_threads - define how many parallel threads we

    # should start


    npcd_max_threads = 5


    # sleep_time - how many seconds npcd should wait between dirscans

    #

    # sleep_time = 15 (default)


    sleep_time = 15



    # EXPERIMENTAL

    #

    # load_threshold - npcd won't start new threads

    # if your system load is above this threshold

    #

    # load_threshold = <float value> (default: 0.0)

    #

    # Hint: Do not use "," as decimal delimiter

    #

    # 07/15/2008: Every value above 0.0 will

    # enable this feature


    load_threshold = 0.0



    # location of your pid file


    pid_file=/var/run/npcd.pid



    #########################

    # #

    # NPCDMOD OPTIONS #

    # #

    #########################



    # perfdata_file - where should the npcdmod.o

    # write the performance data

    #

    # must not be within the same directory as

    # perfdata_spool_dir

    #

    # perfdata_file = </path/to/file>

    #


    perfdata_file = /usr/local/pnp4nagios/var/perfdata.dump



    # perfdata_spool_filename - declare the destination

    # filename for the spooled files

    #

    # This option allows you a customized filename.

    # Usefull if you own different nagios servers

    # which write their data to a shared storage.

    #

    # perfdata_spool_filename = <filename>

    #

    # Hint:

    # The final files will be moved to

    # 'perfdata_spool_dir/perfdata_spool_filename-TIMESTAMP'

    #

    # Example:

    #

    # perfdata_spool_filename = perfdata-NY

    # perfdata_spool_filename = perfdata-LA


    perfdata_spool_filename = perfdata


    #

    # perfdata_file_processing_interval

    #

    perfdata_file_processing_interval = 15


    # We have to end with a newline

  • $find / -name commands.cfg


    /etc/icinga/commands.cfg

    /usr/local/pnp4nagios/etc/objects/commands.cfg


    /usr/local/nagios/objects/commands.cfg (Already displayed in the above post)

    /usr/local/icinga/etc/objects/commands.cfg (Already displayed in the above post)


    /usr/share/doc/icinga-common/examples/commands.cfg

    /usr/share/doc/icinga-common/examples/template-object/commands.cfg


    *******************************************


    vim /usr/local/pnp4nagios/etc/objects/commands.cfg



    # 'process-host-perfdata' command definition

    #define command{

    # command_name process-host-perfdata

    # command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out

    # }



    # 'process-service-perfdata' command definition

    #define command{

    # command_name process-service-perfdata

    # command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out

    # }


    # 'process-host-perfdata' command definition

    define command{

    command_name process-host-perfdata

    command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$$

    }


    # 'process-service-perfdata' command definition

    define command{

    command_name process-service-perfdata

    command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$$

    }


    #define command{

    #command_name process-service-perfdata-file

    #command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$

    #}


    #define command{

    #command_name process-host-perfdata-file

    #command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$

    #}

  • I am working around in this for last 2 weeks and where I lack, is I am still not able to figure out how the files are linked.

    I have icingaweb2 working fine and I got Director module installed.


    In case of the pnp4nagios module, which one is the main configuration file and which rest are the supporting sub configuration file.

    Please help. I am looking for a detailed lecture.

  • I am working around in this for last 2 weeks and where I lack, is I am still not able to figure out how the files are linked.

    I have icingaweb2 working fine and I got Director module installed.

    The config you showed belong to Nagios / Icinga 1.x, IcingaWeb and Director (to my knowledge) to Icinga2.


    You have to decide which way you'd like to follow...