pnp4nagios 0.6.25 BULK Mode with NPCD

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.
Pikmin
Posts: 82
Joined: Tue Feb 17, 2015 5:32 pm

pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Pikmin »

Hello everyone,
I've decided to come back and try adding pnp4nagios back into my nagios core

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

Code: Select all

[INFO]  ========== Starting Environment Checks ============
[INFO]  My version is: verify_pnp_config-0.6.25-R.40
[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/dell/resources/dell_resource.cfg
[INFO]  Reading /usr/local/nagios/dell/resources/dell_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.25"
[OK  ]  ./configure Options '--with-nagios-user=nagios' '--with-nagios-group=nagcmd'
[OK  ]  Effective User is 'nagios'
[OK  ]  User nagios exists with ID '1001'
[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$\tSERVICEPERF
DATA::$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
--More--service_perfdata_file_processing_command at verify_pnp_config line 462.
host_perfdata_file_processing_command at verify_pnp_config line 462.
[OK  ]  host_perfdata_file_template is defined
[OK  ]  host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAN
D::$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  ]  -1 files found in /usr/local/pnp4nagios/var/spool
[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
[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 <[email protected]>
[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
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/_HOST_.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/_HOST_.xml: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/RAM_Utilisation.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/RAM_Utilisation.xml: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Event_Log_Application_Warnings.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Event_Log_Application_Warnings.xml: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Event_Log_System_Warnings.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Event_Log_System_Warnings.xml: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Page_File.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Page_File.xml: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Network.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Network.xml: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Disk_Space_-_All.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/Disk_Space_-_All.xml: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/CPU.rrd: group is nagcmd
[CRIT]  /usr/local/pnp4nagios/var/perfdata/NDPRT/CPU.xml: group is nagcmd
....
....
[WARN]  361 hosts/services are not providing performance data
[WARN]  'process_perf_data 1' is set for 362 hosts/services which are not providing performance data!
[OK  ]  'process_perf_data 1' is set for 1072 of your hosts/services
[INFO]  ==== System sizing ====
[OK  ]  1071 hosts/service objects defined
[INFO]  ==== Check statistics ====
[CRIT]  Warning: 2, Critical: 1044
[CRIT]  Checks finished...
I have compiled pnp4nagios --with-nagios-group=nagcmd option

Code: Select all

ls -l /usr/local/pnp4nagios/var/perfdata/NDPRT/
total 9800
-rw-rw-r--. 1 nagios nagcmd 1151496 Nov 12 12:53 CPU.rrd
-rw-rw-r--. 1 nagios nagcmd    3440 Nov 12 12:53 CPU.xml
-rw-rw-r--. 1 nagios nagcmd 1534768 Nov 12 12:50 Disk_Space_-_All.rrd
-rw-rw-r--. 1 nagios nagcmd    4169 Nov 12 12:50 Disk_Space_-_All.xml
-rw-rw-r--. 1 nagios nagcmd  384952 Nov 12 12:50 Event_Log_Application_Warnings.rrd
-rw-rw-r--. 1 nagios nagcmd    2119 Nov 12 12:50 Event_Log_Application_Warnings.xml
-rw-rw-r--. 1 nagios nagcmd  384952 Nov 12 12:50 Event_Log_System_Warnings.rrd
-rw-rw-r--. 1 nagios nagcmd    2079 Nov 12 12:50 Event_Log_System_Warnings.xml
-rw-rw-r--. 1 nagios nagcmd  768224 Nov 12 12:53 _HOST_.rrd
-rw-rw-r--. 1 nagios nagcmd    2527 Nov 12 12:53 _HOST_.xml
-rw-rw-r--. 1 nagios nagcmd 3067856 Nov 12 12:50 Network.rrd
-rw-rw-r--. 1 nagios nagcmd    7229 Nov 12 12:50 Network.xml
-rw-rw-r--. 1 nagios nagcmd 1918040 Nov 12 12:51 Page_File.rrd
-rw-rw-r--. 1 nagios nagcmd    5025 Nov 12 12:51 Page_File.xml
-rw-rw-r--. 1 nagios nagcmd  768224 Nov 12 12:51 RAM_Utilisation.rrd
-rw-rw-r--. 1 nagios nagcmd    2791 Nov 12 12:51 RAM_Utilisation.xml
It looks like the script doesn't like or have an option to specify another group
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Box293 »

Try editing the file /usr/local/nagios/etc/pnp/npcd.cfg and change the defined group in there.

Once done, restart the npcd service:

Code: Select all

service npcd restart
Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Pikmin
Posts: 82
Joined: Tue Feb 17, 2015 5:32 pm

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Pikmin »

Thank you!

I have already modified /usr/local/pnp4nagios/etc/npcd.cfg
I hope that's the right file for me as the one you specified doesn't exist on my system

Code: Select all

# Privilege Options

user = nagios
group = nagcmd

Code: Select all

systemctl status npcd.service
npcd.service - LSB: pnp4nagios NPCD Daemon Version 0.6.25
   Loaded: loaded (/etc/rc.d/init.d/npcd)
   Active: active (running) since Thu 2015-11-12 14:08:43 AEDT; 2s ago
  Process: 9070 ExecStart=/etc/rc.d/init.d/npcd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/npcd.service
           ├─9077 /usr/local/pnp4nagios/bin/npcd -d -f /usr/local/pnp4nagios/etc/npcd.cfg
           └─9147 /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -n --bulk /usr/local/pnp4nagios/var/spool/host-perfdata.1447295002
When I browse to server-ip/pnp4nagios i am actually getting graphs generated, however under services I'm seeing Host Perfdata and PING, so not all services that I have show up, Windows hosts where I'm using wmic checks all show up:
Host Perfdata CPU DFS Replication Disk Space - All Event Log Application War... Event Log System Warnings Network Page File RAM Utilisation

For example I have a Cisco switch - NDC-SW-Admin with 54 checks but in pnp4nagios I'm only seeing the ping service and Host Perfdata, so 2 out of 54. How does pnp4nagios know which services to graph and which not to?
EDIT: Looks like the other's can't really be graphed as they are text info only
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Box293 »

Pikmin wrote:I have already modified /usr/local/pnp4nagios/etc/npcd.cfg
I hope that's the right file for me as the one you specified doesn't exist on my system
Yeah thats OK, different systems have different directories.
Pikmin wrote:EDIT: Looks like the other's can't really be graphed as they are text info only
Bang that's exactly it.

I did a talk on this at the Nagios World Conference, you can watch it here:

https://www.youtube.com/watch?v=kqA2KcpUFg4
http://www.slideshare.net/nagiosinc/tro ... and-graphs

While it's Nagios XI based, the basics about performance data and plugins is the same and the directories might be a bit different in your installation.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Pikmin
Posts: 82
Joined: Tue Feb 17, 2015 5:32 pm

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Pikmin »

Cheers mate, thanks for the clarification.
Thanks for the youtube links, will definitely watch them
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by rkennedy »

Sounds good. Let us know if you need more assistance - I'll leave this thread open for now.
Former Nagios Employee
Pikmin
Posts: 82
Joined: Tue Feb 17, 2015 5:32 pm

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Pikmin »

I do have one question, I saw the youtube links late last night and didn't have time to watch them, saw about 25 min of the first one.

Trying to make sense out why mrtg and pnp4nagios are not really showing the same data. From the video if I remember correctly pnp4nagios averages data but still these don't look right to me.

I am looking at the data source in and in mrtg we can see it's more or less a steady 12 MB/s from 7-11 this morning, that same data in pnp4nagios (Datasource: in) doesn't show much at all - from 7-11 it's almost zero
Attachments
pnp4nagios
pnp4nagios
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Box293 »

Bare with me as I don't often use these two products outside of Nagios XI.

So I assume you have MRTG working and then you have a Nagios service setup which queries the MRTG data (for which PNP graphs are generated)`?

Can you show us the MRTG config for Tunnel0 and then the Nagios service definition for Tunnel 0.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Pikmin
Posts: 82
Joined: Tue Feb 17, 2015 5:32 pm

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Pikmin »

Yeah I have mrtg installed and it's monitoring the switch ports. Sorry I only use the free version of Nagios Core

This is the part of mrtg.cfg that shows tunnel0, just edited this part again, didn't paste properly

Code: Select all

### Interface 5 >> Descr: 'Tunnel0' | Name: 'Tu0' | Ip: '192.168.199.5' | Eth: 'No Ethernet Id' ###

Target[192.168.199.1_5]: 5:[email protected]:
SetEnv[192.168.199.1_5]: MRTG_INT_IP="192.168.199.5" MRTG_INT_DESCR="Tunnel0"
MaxBytes[192.168.199.1_5]: 12500000
Title[192.168.199.1_5]: Traffic Analysis for 5 -- something.edu.au
PageTop[192.168.199.1_5]: <h1>Traffic Analysis for 5 -- something.edu.au</h1>
                <div id="sysdetails">
                        <table>
                               	<tr>
                                    	<td>System:</td>
                                        <td>something.edu.au in XXXXXXXXXXXXXXXXXXXX</td>
                                </tr>
                                <tr>
                                    	<td>Maintainer:</td>
                                        <td></td>
                                </tr>

                                <tr>
                                    	<td>Description:</td>
                                        <td>Tunnel0  </td>
                                </tr>
                                <tr>
                                    	<td>ifType:</td>
                                        <td>Encapsulation Interface (131)</td>
                                </tr>
                                <tr>
                                    	<td>ifName:</td>
                                        <td>Tu0</td>
                                </tr>
                                <tr>
                                    	<td>Max Speed:</td>
                                        <td>12.5 MBytes/s</td>
                                </tr>
                                <tr>
                                        <td>Ip:</td>
                                        <td>192.168.199.5 (No DNS name)</td>
                                </tr>
                        </table>
                </div>

I noticed in the previously attached screenshot when you look at the pnp4nagios side it shows the warning and critical which are in bytes but not translated correctly ?? - Warning shows 11250000.000000 while for example KB/s Max shows 84.5176
Looks like way too many zeroes in the Warning Critical part?

Service

Code: Select all

define service{
       	use                     generic-service ; Inherit values from a template
        host_name               something-wan-router
        service_description     Tunnel0
        check_command           check_local_mrtgtraf!/var/www/mrtg/192.168.199.1_5.log!AVG!11250000,11250000!11875000,11875000!10
        }
perfdata.log one section for tunnel0

Code: Select all

2015-11-13 11:48:21 [24015] [2] Processing Line 12
2015-11-13 11:48:21 [24015] [2] Datatype set to 'SERVICEPERFDATA'
2015-11-13 11:48:21 [24015] [1] Found Performance Data for something-router / Tunnel0 (in=166.028320KB/s;11250000.000000;11875000.000000;0.000000 out=89.237305KB/s;11250000.000000;11875000.00$
2015-11-13 11:48:21 [24015] [2] data2rrd called
2015-11-13 11:48:21 [24015] [2] RRDs::update /usr/local/pnp4nagios/var/perfdata/something-router/Tunnel0.rrd 1447375698:166.028320:89.237305
2015-11-13 11:48:21 [24015] [2] /usr/local/pnp4nagios/var/perfdata/something-router/Tunnel0.rrd updated
2015-11-13 11:48:21 [24015] [1] 12 lines processed
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: pnp4nagios 0.6.25 BULK Mode with NPCD

Post by Box293 »

Don't be sorry, Nagios is great because there are so many ways of using it!

So basically what is happening here is that MRTG has the data most closest to the device.

When I checks it gets an octets value and then calculates the difference from last time and stores this in /var/www/mrtg/192.168.199.1_5.log.

Then your nagios service queries this file and calculates the difference from last time and then the plugin returns this as performance data.

PNP then gets the performance data and when it inserts it into it's RRD file it calculates the difference from last time and hence the data is averaged some more.

This might not be 100% correct but it's close. The point I'm making is that your PNP graphs are the furtherest from the source so the averaging is reducing the results.

But also, what is the command definition for check_local_mrtgtraf ? And what is the specific plugin that is being used, where did you download it from. I'm guessing that the last argument "10" is for an option which would have something to do with the interface speed perhaps?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked