check-cisco.pl : trying to graph the data using pnp4

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
jchavez
Posts: 2
Joined: Sun Apr 08, 2018 3:27 pm
Location: MX

check-cisco.pl : trying to graph the data using pnp4

Post by jchavez »

I am trying to graph the data using pnp4, I using check_cisco but do not display graphs,
with other plugins if it works as with check_snmp
:(

File: /usr/local/nagios/etc/objects/cisco_switch.cfg

define host {
use generic-host,host-pnp
host_name 62.253-XXXXXXXXXX
alias cisco
address X.X.62.253
notes Cisco Dist
check_command check-host-alive
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
contact_groups TI-ContactGroup
# parents none
icon_image vendors/cisco3.png
statusmap_image vendors/cisco3.gd2
}

define service {
hostgroup_name Cisco_switch
service_description Interface Eth 1/1 status
check_command Cisco_check_command! -C public -i Ethernet1/1
use generic-service,srv-pnp
}

File: /usr/local/nagios/etc/objects/commands.cfg

define command{
command_name Cisco_check_command
command_line $USER1$/check_cisco.pl -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$
}

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

####

Performance data empty:

[root@localhost ~]# ls -l /usr/local/pnp4nagios/var/perfdata/62.252-MICH-7018-02_MDF/
total 756
-rw-rw-r-- 1 nagios nagios 768224 Apr 8 15:07 _HOST_.rrd
-rw-rw-r-- 1 nagios nagios 2653 Apr 8 15:07 _HOST_.xml
[root@localhost ~]#

It works with check_snmp command:
[root@localhost ~]# ls -l /usr/local/pnp4nagios/var/perfdata/65.132_PIE-MDF-DIV_SIS-C3650-48P-01_04/
total 6076
-rw-rw-r-- 1 nagios nagios 768224 Apr 8 15:10 _HOST_.rrd
-rw-rw-r-- 1 nagios nagios 2758 Apr 8 15:10 _HOST_.xml
-rw-rw-r-- 1 nagios nagios 384952 Apr 8 15:09 ifOperStatus_St1-1_1_up_2_down.rrd
-rw-rw-r-- 1 nagios nagios 2361 Apr 8 15:09 ifOperStatus_St1-1_1_up_2_down.xml
-rw-rw-r-- 1 nagios nagios 384952 Apr 8 15:02 Porcentaje_de_ocupación_total_de_CPU1.rrd
-rw-rw-r-- 1 nagios nagios 2470 Apr 8 15:02 Porcentaje_de_ocupación_total_de_CPU1.xml
[root@localhost ~]#

[root@localhost /]# ls -l /usr/local/pnp4nagios/var/perfdata/65.153_XXXXXXXXXXXXX/
total 1136
-rw-rw-r-- 1 nagios nagios 768224 Apr 8 01:29 _HOST_.rrd
-rw-rw-r-- 1 nagios nagios 2709 Apr 8 01:29 _HOST_.xml
-rw-rw-r-- 1 nagios nagios 384952 Apr 8 01:29 Temperatura.rrd
-rw-rw-r-- 1 nagios nagios 2232 Apr 8 01:29 Temperatura.xml

But not work with check_cisco :shock: :shock:
[root@localhost /]# ls -l /usr/local/pnp4nagios/var/perfdata/62.252XXXXXXXXXXXXX/
total 756
-rw-rw-r-- 1 nagios nagios 768224 Apr 8 01:26 _HOST_.rrd
-rw-rw-r-- 1 nagios nagios 2653 Apr 8 01:26 _HOST_.xml
[root@localhost /]#

[root@localhost ~]# find / -name check_cisco.pl
/home/centosuser/check_cisco.pl
/usr/lib64/nagios/plugins/check_cisco.pl
/usr/local/nagios/libexec/check_cisco.pl
[root@localhost ~]# ls -l /usr/lib64/nagios/plugins/check_cisco.pl
-rwxr-xr-x 1 root root 6632 Feb 28 2017 /usr/lib64/nagios/plugins/check_cisco.pl
[root@localhost ~]# ls -l /usr/local/nagios/libexec/check_cisco.pl
-rwxr-xr-x 1 nagios nagios 6632 Jun 15 2016 /usr/local/nagios/libexec/check_cisco.pl
[root@localhost ~]# ls -l /usr/local/nagios/libexec/check_snmp
-rwxr-xr-x. 1 nagios nagios 252782 Mar 24 2016 /usr/local/nagios/libexec/check_snmp
[root@localhost ~]# ls -l /usr/lib64/nagios/plugins/check_snmp
-rwxr-xr-x. 1 root root 83216 Sep 11 2015 /usr/lib64/nagios/plugins/check_snmp
[root@localhost ~]#

[root@localhost ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 87 services.
Checked 61 hosts.
Checked 4 host groups.
Checked 0 service groups.
Checked 4 contacts.
Checked 4 contact groups.
Checked 58 commands.
Checked 6 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 61 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 6 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
[root@localhost ~]#

[root@localhost ~]# service httpd status |grep run && service npcd status && service nagios status
Redirecting to /bin/systemctl status httpd.service
Active: active (running) since Sun 2018-04-08 14:46:09 CDT; 55min ago
npcd (pid 21202) is running...
nagios (pid 21253) is running...
[root@localhost ~]#


[root@localhost ~]# perl 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.26-R.44
[INFO] Start Options: 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.24"
[OK ] Configured User is 'nagios'
[OK ] Effective User is 'nagios'
[OK ] User nagios exists with ID '1001'
[OK ] Configured Group is 'nagios'
[OK ] Effective group is 'nagios'
[OK ] Group nagios exists with ID '1001'
[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=/usr/local/pnp4nagios/var/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
[OK ] host_perfdata_file is defined
[OK ] host_perfdata_file=/usr/local/pnp4nagios/var/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
[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 ] 0 files found in /usr/local/pnp4nagios/var/spool
service_perfdata_file_processing_command at verify_pnp_config line 612.
[OK ] Command process-service-perfdata-file is defined
[OK ] '/bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$'
[OK ] Command looks good
host_perfdata_file_processing_command at verify_pnp_config line 612.
[OK ] Command process-host-perfdata-file is defined
[OK ] '/bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$'
[OK ] Command looks good
[OK ] Script /usr/local/pnp4nagios/libexec/process_perfdata.pl is executable
[INFO] ========== Starting global checks ============
[OK ] status_file is defined
[OK ] status_file=/usr/local/nagios/var/status.dat
[INFO] host_query =
[INFO] service_query =
[INFO] Reading /usr/local/nagios/var/status.dat
[INFO] ==== Starting rrdtool checks ====
[OK ] RRDTOOL is defined
[OK ] RRDTOOL=/usr/bin/rrdtool
[OK ] /usr/bin/rrdtool is executable
[OK ] RRDtool 1.4.8 Copyright 1997-2013 by Tobias Oetiker <tobi@oetiker.ch>
[OK ] USE_RRDs is defined
[OK ] USE_RRDs=1
[OK ] Perl RRDs modules are loadable
[INFO] ==== Starting directory checks ====
[OK ] RRDPATH is defined
[OK ] RRDPATH=/usr/local/pnp4nagios/var/perfdata
[OK ] Perfdata directory '/usr/local/pnp4nagios/var/perfdata' exists
[WARN] 2 hosts/services are not providing performance data
[WARN] 'process_perf_data 1' is set for 3 hosts/services which are not providing performance data!

[OK ] 'process_perf_data 1' is set for 149 of your hosts/services
[INFO] ==== System sizing ====
[OK ] 148 hosts/service objects defined
[INFO] ==== Check statistics ====
[WARN] Warning: 2, Critical: 0
[WARN] Checks finished...

[root@localhost ~]#
Attachments
pnp4nagios status graphs
pnp4nagios status graphs
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check-cisco.pl : trying to graph the data using pnp4

Post by mcapra »

Thanks for sharing a rather comprehensive chunk of information.

Assuming you are using this version of check_cisco.pl:
https://exchange.nagios.org/directory/P ... rs/details

This plugin does not appear to provide performance data. In other words, the plugin would need to be altered to provide performance data in order for pnp4nagios to graph it. This is a limitation of the check_cisco.pl plugin; Not Nagios Core or pnp4nagios. The plugin is just making simple snmp walk and get calls, so you could probably pull the particular OIDs out and configure them with check_snmp as an alternative. This would require a bit of research and knowledge of SNMP.

Here's more info on how plugins can provide performance data to be consumed by Nagios Core:
https://nagios-plugins.org/doc/guidelines.html#AEN200
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check-cisco.pl : trying to graph the data using pnp4

Post by scottwilkerson »

Thanks @mcapra!

As @mcapra pointed out you would need to either add performance data to the plugin or use a different plugin.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
jchavez
Posts: 2
Joined: Sun Apr 08, 2018 3:27 pm
Location: MX

Re: check-cisco.pl : trying to graph the data using pnp4

Post by jchavez »

I am now using the check_cisco plugin, This works!
:D Thanks!!!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check-cisco.pl : trying to graph the data using pnp4

Post by scottwilkerson »

Excellent, glad to hear you found a plugin that had what you wanted.

Closing.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked