Page 2 of 3

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Mon Apr 10, 2017 1:44 am
by dsnagi
Hi all,
I was very busy with other task at my work, and yet shortly started working on this.
I stuck with maybe simple task, recompiling broker module, does it simply mean reinstallation of pnp4nagios module?

Also do you thing that interfacetable_v3t is culprit?

Why I think that maybe interfacetable_v3t is culprit is because I'm not getting my rrd files updated. Firts time I thought file permissions are wrong, but they are not I would say now.

Many thanks.

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Mon Apr 10, 2017 1:28 pm
by tgriep
If all of performance graphs are not working, the first step would be to reinstall pnp4nagios and verify that it is working.
Here are the instructions for installing pnp4nagios
https://docs.pnp4nagios.org/pnp-0.6/install

I suggest using Bulk Mode with NPCD for the pnp4nagios configuration settings. Take a look at the link below for the configuring that.
https://docs.pnp4nagios.org/pnp-0.6/con ... _with_npcd

Take a look at this link for some troubleshooting steps for pnp4nagios in case reinstalling doesn't work for you.
https://docs.pnp4nagios.org/pnp-0.6/verify

One thing to note, if the upgraded plugins have different performance data output than the old plugins, that will stop the graphs from functioning.
Try deleting the .xml and .rrd files for one of the checks and see if the graphs start to function again.

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Wed Apr 19, 2017 4:21 am
by dsnagi
Thanks for your links tgriep, they are very useful.

Using verify_pnp_config.pl I got a lot of red [CRIT] messages, fixed them almost all, ended up with this one only: [CRIT] Directory /usr/local/pnp4nagios/etc/config.php does not exist.

But I can see that directory and file exist.

Please see my output of verify_pnp_config.pl and ls commands:

***
[root@my-host-name snmp]# perl /root/verify_pnp_config --mode=bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc/config.php

Code: Select all

[INFO]  ========== Starting Environment Checks ============
[INFO]  My version is: verify_pnp_config-0.6.25-R.40
[INFO]  Start Options: /root/verify_pnp_config --mode=bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc/config.php
[INFO]  Reading /usr/local/nagios/etc/nagios.cfg
[OK  ]  Running product is 'nagios'
[OK  ]  object_cache_file is defined
[OK  ]  object_cache_file=/usr/local/nagios/var/objects.cache
[INFO]  Reading /usr/local/nagios/var/objects.cache
[OK  ]  resource_file is defined
[OK  ]  resource_file=/usr/local/nagios/etc/resource.cfg
[INFO]  Reading /usr/local/nagios/etc/resource.cfg
[CRIT]  Directory /usr/local/pnp4nagios/etc/config.php does not exist
[root@my-host-name snmp]# ls -l /usr/local/pnp4nagios/etc/
total 160

Code: Select all

-rw-r--r-- 1 nagios nagios 29383 Vel 19  2013 background.pdf
drwxr-xr-x 2 nagios nagios  4096 Vel 19  2013 check_commands
drwxr-xr-x 2 nagios nagios  4096 Vel 19  2013 config.d
-rw-r--r-- 1 nagios nagios  9606 Vel 19  2013 config_local.php
-rw-r--r-- 1 nagios nagios  9606 Vel 19  2013 config.php
-rw-r--r-- 1 nagios nagios  9606 Vel 19  2013 config.php.0.6.19
-rw-r--r-- 1 nagios nagios  1358 Vel 19  2013 misccommands.cfg-sample
-rw-r--r-- 1 nagios nagios  1692 Vel 19  2013 nagios.cfg-sample
-rw-r--r-- 1 nagios nagios  4162 Vel 19  2013 npcd.cfg
drwxr-xr-x 2 nagios nagios  4096 Vel 19  2013 pages
-rw-r--r-- 1 nagios nagios   112 Vel 19  2013 pnp4nagios_release
-rw-r--r-- 1 nagios nagios  2520 Vel 19  2013 process_perfdata.cfg
-rw-r--r-- 1 nagios nagios   651 Vel 19  2013 rra.cfg-sample

Also I removed .rrd and .xml files for one interface at one switch (host) and there were no new .rrd and .xml files for that interface (If_GigabitEthernet1_0_9).

Clicking on graph icon for that interface (If_GigabitEthernet1_0_9) in nagios web interface I receive this:

***
PNP4Nagios Version 0.6.19
Please check the documentation for information about the following error.
XML file "/usr/local/pnp4nagios/var/perfdata/***host-name-of-the-switch***/If_GigabitEthernet1_0_9.xml" not found. Read FAQ online

file [line]:
application/models/data.php [312]:

back
***

According to "Performance data will be stored in Round Robin Databases using RRDtool." from https://docs.pnp4nagios.org/pnp-0.6/about RRDtool is responsible for file creation on file system.

Does RRDtool create both .rrd and .xml files?

From this command below please see that I have rrdtool, php, and perl installed:

***
[root@my-host-name ~]# rpm -qa | egrep 'perl|rrdtool|php'

Code: Select all

perl-Convert-ASN1-0.22-1.el5.rf
perl-Archive-Tar-1.39.1-1.el5_5.2
perl-version-0.7203-1.el5
perl-MIME-Lite-3.028-1.el5.rf
perl-IO-Socket-INET6-2.57-2.el5.rf
perl-Date-Calc-5.4-1.2.2.1
perl-Mozilla-LDAP-1.5.2-4.el5
perl-Gearman-1.09-1.el5
perl-libwww-perl-5.805-1.1.1
perl-IP-Country-2.27-1.el5.rf
perl-Test-Pod-1.45-1.el5.rf
perl-Exception-Class-1.29-1.el5.rf
perl-Carp-Clan-5.3-1.2.1
perl-Encode-Detect-1.01-1.el5.rf
perl-XML-NamespaceSupport-1.11-1.el5.rf
perl-String-CRC32-1.4-2.fc6
perl-Razor-Agent-2.85-1.el5.rf
php-ldap-5.1.6-39.el5_8
perl-Crypt-OpenSSL-RSA-0.28-1.el5.rf
perl-Sort-Naturally-1.02-1.2.el5.rf
perl-IO-Compress-2.030-2.el5.rf
perl-HTML-Tagset-3.20-1.el5.rf
perl-XML-Twig-3.26-1.fc6
perl-Bit-Vector-6.4-2.2.2.1
perl-Crypt-DES-2.05-3.2.el5.rf
php-gd-5.1.6-39.el5_8
rrdtool-1.2.27-4.el5
perl-5.8.8-43.el5_11
perl-Compress-Raw-Bzip2-2.052-1.el5.rf
subversion-perl-1.6.11-10.el5_8
perl-Digest-HMAC-1.01-15
perl-DBI-1.615-1.el5.rf
perl-Crypt-OpenSSL-Bignum-0.04-7.el5
perl-Email-Date-Format-1.002-4.el5
perl-URI-1.35-3
perl-BSD-Resource-1.2903-1.el5.rf
perl-XML-Grove-0.46alpha-29.1.1
perl-Geography-Countries-2009041301-1.el5.rf
perl-Crypt-OpenSSL-Random-0.04-7.el5
perl-rrdtool-1.4.7-1.el5.rf
perl-Devel-StackTrace-1.2600-2.el5.rf
php-cli-5.1.6-39.el5_8
perl-Net-Telnet-3.03-5
mod_perl-2.0.4-6.el5
perl-IO-Zlib-1.10-1.el5.rf
perl-Test-Manifest-1.23-1.el5.rf
perl-Data-Dumper-2.125-1.el5.rf
perl-MailTools-2.09-1.el5.rf
net-snmp-perl-5.3.2.2-20.el5
perl-Net-SSLeay-1.36-1.el5.rf
perl-Crypt-PasswdMD5-1.3-2.el5
perl-XML-SAX-0.96-1.el5.rf
perl-Pod-Simple-3.16-1.el5.rf
newt-perl-1.08-9.2.2
perl-Config-General-2.44-1.el5.rf
perl-IO-Socket-SSL-1.34-1.el5.rf
perl-NetAddr-IP-4.044-1.el5.rf
rrdtool-1.4.7-1.el5.rf
perl-Compress-Raw-Zlib-2.052-1.el5.rf
perl-YAML-0.72-1.el5.rf
php-5.1.6-39.el5_8
perl-Socket6-0.23-1.el5.rf
perl-Net-Ident-1.23-1.el5.rf
perl-libxml-perl-0.08-1.2.1
perl-Mail-DKIM-0.39-1.el5.rf
perl-Git-1.7.11.3-1.el5.rf
perl-Class-Data-Inheritable-0.08-1.el5.rf
perl-Pod-Escapes-1.04-5.el5
perl-Archive-Zip-1.16-1.2.1
perl-Crypt-SSLeay-0.51-11.el5
php-common-5.1.6-39.el5_8
perl-Net-SNMP-5.2.0-1.2.el5.rf
perl-5.8.8-43.el5_11
perl-XML-Dumper-0.81-2.fc6
perl-XML-Parser-2.34-6.1.2.2.1
perl-Error-0.17010-1.el5
perl-Net-IP-1.25-2.fc6
perl-HTML-Parser-3.68-1.el5.rf
perl-Net-DNS-0.66-1.el5.rf
perl-Date-Manip-5.56-1.el5.rf
perl-Digest-SHA-5.71-1.el5.rf
perl-LDAP-0.33-4.el5_8
perl-Mail-SPF-2.007-1.el5
perl-Digest-SHA1-2.13-1.el5.rf
perl-XML-LibXML-1.69-3.el5.rf
perl-TimeDate-1.16-5.el5
perl-Crypt-Rijndael-1.09-1.el5.rf

Sorry for a long post.

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Wed Apr 19, 2017 9:43 am
by tgriep
The verify_pnp_config command you ran should not have included the config.php in the command, only the directory should of been used.
Login to the Nagios server, run the following command and then resolve any errors you have and see if the graphs start to populate.

Code: Select all

perl /root/verify_pnp_config --mode=bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc/

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Wed Apr 19, 2017 11:25 am
by dsnagi
I got this:

[root@my-host-name snmp]# perl /root/verify_pnp_config --mode=bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc/
[INFO] ========== Starting Environment Checks ============
[INFO] My version is: verify_pnp_config-0.6.25-R.40
[INFO] Start Options: /root/verify_pnp_config --mode=bulk+npcd --config=/usr/local/nagios/etc/nagios.cfg --pnpcfg=/usr/local/pnp4nagios/etc/
[INFO] Reading /usr/local/nagios/etc/nagios.cfg
[OK ] Running product is 'nagios'
[OK ] object_cache_file is defined
[OK ] object_cache_file=/usr/local/nagios/var/objects.cache
[INFO] Reading /usr/local/nagios/var/objects.cache
[OK ] resource_file is defined
[OK ] resource_file=/usr/local/nagios/etc/resource.cfg
[INFO] Reading /usr/local/nagios/etc/resource.cfg
[INFO] Reading /usr/local/pnp4nagios/etc//process_perfdata.cfg
[INFO] Reading /usr/local/pnp4nagios/etc//pnp4nagios_release
[OK ] Found PNP4Nagios version "0.6.19"
[OK ] Effective User is 'nagios'
[OK ] User nagios exists with ID '501'
[OK ] Effective group is 'nagios'
[OK ] Group nagios exists with ID '501'
[INFO] ========== Checking Bulk Mode + NPCD Config ============
[OK ] process_performance_data is 1 compared with '/1/'
[OK ] service_perfdata_file is defined
[OK ] service_perfdata_file=/tmp/service-perfdata
[OK ] service_perfdata_file_template is defined
[OK ] service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
[OK ] PERFDATA template looks good
[OK ] service_perfdata_file_mode is defined
[OK ] service_perfdata_file_mode=a
[OK ] service_perfdata_file_processing_interval is defined
[OK ] service_perfdata_file_processing_interval=15
[OK ] service_perfdata_file_processing_command is defined
[OK ] service_perfdata_file_processing_command=process-service-perfdata-file-bulk-npcd
[OK ] host_perfdata_file is defined
[OK ] host_perfdata_file=/tmp/host-perfdata
[OK ] host_perfdata_file_template is defined
[OK ] host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
[OK ] PERFDATA template looks good
[OK ] host_perfdata_file_mode is defined
[OK ] host_perfdata_file_mode=a
[OK ] host_perfdata_file_processing_interval is defined
[OK ] host_perfdata_file_processing_interval=15
[OK ] host_perfdata_file_processing_command is defined
[OK ] host_perfdata_file_processing_command=process-host-perfdata-file-bulk-npcd
[INFO] Nagios config looks good so far
[INFO] ========== Checking config values ============
[OK ] npcd daemon is running
[OK ] /usr/local/pnp4nagios/etc/npcd.cfg is used by npcd and readable
[INFO] Reading /usr/local/pnp4nagios/etc/npcd.cfg
[OK ] perfdata_spool_dir is defined
[OK ] perfdata_spool_dir=/usr/local/pnp4nagios/var/spool
[OK ] -1 files found in /usr/local/pnp4nagios/var/spool
service_perfdata_file_processing_command at /root/ds/verify_pnp_config line 462.
[OK ] Command process-service-perfdata-file-bulk-npcd is defined
[OK ] '/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/perfdata/service-perfdata.$TIMET$'
[INFO] Regex = (?-xism:/bin/mv\s+/tmp/service-perfdata\s+/usr/local/pnp4nagios/var/spool)
[CRIT] Command looks suspect (/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/perfdata/service-perfdata.$TIMET$)

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Wed Apr 19, 2017 12:35 pm
by tgriep
That CRIT error looks like there is a configuration issue in the commands.cfg file.
Take a look at this link for how to setup the server for Bulk Mode with NPCD if that is how the server is setup.
https://docs.pnp4nagios.org/pnp-0.6/con ... _with_npcd

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Tue Apr 25, 2017 1:39 am
by dsnagi
I can see that there are commands "process-host-perfdata" - "process-service-perfdata" and "process-host-perfdata-file-bulk-npcd" - "process-service-perfdata-file-bulk-npcd".
Is this ok?

Please see my commands.cfg file below:

Code: Select all

[root@my-host-name objects]# less commands.cfg
###############################################################################
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 3.4.4
#
# 
#
# NOTES: This config file provides you with some example command definitions
#        that you can reference in host, service, and contact definitions.
#       
#        You don't need to keep commands in a separate file from your other
#        object definitions.  This has been done just to make things easier to
#        understand.
#
###############################################################################


################################################################################
#
# SAMPLE NOTIFICATION COMMANDS
#
# These are some example notification commands.  They may or may not work on
# your system without modification.  As an example, some systems will require 
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
#
################################################################################


# 'notify-host-by-email' command definition
#define command{
#       command_name    notify-host-by-email
#       command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -- -r user-name@domain-name.top-level-domain
#       }

# 'notify-service-by-email' command definition
#define command{
#       command_name    notify-service-by-email
#       command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -- -r user-name@domain-name.top-level-domain
#       }

define command{
      command_name    notify-host-by-email
      command_line    /usr/bin/php -q /usr/local/nagios/libexec/nagios_mail.php
      }

define command{
      command_name    notify-service-by-email
      command_line    /usr/bin/php -q /usr/local/nagios/libexec/nagios_mail.php
      }



################################################################################
#
# SAMPLE HOST CHECK COMMANDS
#
################################################################################


# This command checks to see if a host is "alive" by pinging it
# The check must result in a 100% packet loss or 5 second (5000ms) round trip 
# average time to produce a critical error.
# Note: Five ICMP echo packets are sent (determined by the '-p 5' argument)

# 'check-host-alive' command definition
define command{
        command_name    check-host-alive
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
        }




################################################################################
#
# SAMPLE SERVICE CHECK COMMANDS
#
# These are some example service check commands.  They may or may not work on
# your system, as they must be modified for your plugins.  See the HTML 
# documentation on the plugins for examples of how to configure command definitions.
#
# NOTE:  The following 'check_local_...' functions are designed to monitor
#        various metrics on the host that Nagios is running on (i.e. this one).
################################################################################

# 'check_local_disk' command definition
define command{
        command_name    check_local_disk
        command_line    $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
        }


# 'check_local_load' command definition
define command{
        command_name    check_local_load
        command_line    $USER1$/check_load -w $ARG1$ -c $ARG2$
        }


# 'check_local_procs' command definition
define command{
        command_name    check_local_procs
        command_line    $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
        }


# 'check_local_users' command definition
define command{
        command_name    check_local_users
        command_line    $USER1$/check_users -w $ARG1$ -c $ARG2$
        }


# 'check_local_swap' command definition
define command{
        command_name    check_local_swap
        command_line    $USER1$/check_swap -w $ARG1$ -c $ARG2$
        }


# 'check_local_mrtgtraf' command definition
define command{
        command_name    check_local_mrtgtraf
        command_line    $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
        }


################################################################################
# NOTE:  The following 'check_...' commands are used to monitor services on
#        both local and remote hosts.
################################################################################

# 'check_ftp' command definition
define command{
        command_name    check_ftp
        command_line    $USER1$/check_ftp -H $HOSTADDRESS$ $ARG1$
        }


# 'check_hpjd' command definition
define command{
        command_name    check_hpjd
        command_line    $USER1$/check_hpjd -H $HOSTADDRESS$ $ARG1$
        }


# 'check_snmp' command definition
define command{
        command_name    check_snmp
        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
        }


# 'check_http' command definition
define command{
        command_name    check_http
        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
        }


# 'check_ssh' command definition
define command{
        command_name    check_ssh
        command_line    $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
        }


# 'check_dhcp' command definition
define command{
        command_name    check_dhcp
        command_line    $USER1$/check_dhcp $ARG1$
        }


# 'check_ping' command definition
define command{
        command_name    check_ping
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
        }


# 'check_pop' command definition
define command{
        command_name    check_pop
        command_line    $USER1$/check_pop -H $HOSTADDRESS$ $ARG1$
        }


# 'check_imap' command definition
define command{
        command_name    check_imap
        command_line    $USER1$/check_imap -H $HOSTADDRESS$ $ARG1$
        }


# 'check_smtp' command definition
define command{
        command_name    check_smtp
        command_line    $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
        }


# 'check_tcp' command definition
define command{
        command_name    check_tcp
        command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
        }


# 'check_udp' command definition
define command{
        command_name    check_udp
        command_line    $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
        }


# 'check_nt' command definition
define command{
        command_name    check_nt
        command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
        }



################################################################################
#
# SAMPLE PERFORMANCE DATA COMMANDS
#
# These are sample performance data commands that can be used to send performance
# data output to two text files (one for hosts, another for services).  If you
# plan on simply writing performance data out to a file, consider using the 
# host_perfdata_file and service_perfdata_file options in the main config file.
#
################################################################################


# '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
#       }

define command {
       command_name    process-service-perfdata
       command_line    /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl
}

define command {
       command_name    process-host-perfdata
       command_line    /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}

#1 

define command {
        command_name    check_interface_table
#1     command_line    /usr/bin/perl /usr/local/nagios/libexec/check_interface_table_v3t.pl -h $HOSTNAME$ -C public -H $HOSTADDRESS$ -f --cp 1
command_line    /usr/bin/perl /usr/local/nagios/libexec/check_interface_table_v3t.pl -h $HOSTNAME$ -C public -H $HOSTADDRESS$ -f --cp 1 --tp='ifOperStatus' --alias --ipinfo
}



define command {
        command_name    check_icmp
        command_line    $USER1$/check_icmp $ARG1
        }

define command {
        command_name    check_dns
        command_line    $USER1$/check_dns $HOSTNAME$
        }



#1

define command {
        command_name    process-service-perfdata-file-bulk-npcd
        #command_name    process-service-perfdata-file
        command_line    /bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/perfdata/service-perfdata.$TIMET$
        }

define command {
        command_name    process-host-perfdata-file-bulk-npcd
        #command_name    process-host-perfdata-file
        command_line    /bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/perfdata/host-perfdata.$TIMET$
        }

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Tue Apr 25, 2017 9:04 am
by tgriep
If your system is setup to run pnp4nagios in Bulk mode with NPCD, then the host and service performance commands in the nagios.cfg should look like this.

Code: Select all

#
# service performance data
#
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

#
# host performance data starting with Nagios 3.0
# 
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
And the commands that are defined in the commands.cfg file should look like this.

Code: Select all

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$
}

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Tue Apr 25, 2017 2:06 pm
by dsnagi
Thank you all of you guys here helping me to solve my problem.
Thank you tgriep for your pointing out nagios.cfg and commands.cfg lines.

Since few minutes my graphs have been being populated :D, I'm so happy.

I did a lot of things, but at the end it seems that changing nagios.cfg and commands.cfg files according to the last tgriep post solved the problem.

Ok, still one problem remains to solve, it is broken link in my email notifications, but first I need to celebrate tgriep's resolution of empty graphs :D 8-)

Re: Nagios upgrade from 3 to 4.3.1 -a lot of issues

Posted: Tue Apr 25, 2017 2:39 pm
by tgriep
That is good to hear that it is working now.
For the email issue, can you screen capture the error that you are seeing as well as posting all of your commands.cfg file.