Plugin not work correctly

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
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Plugin not work correctly

Post by baber »

hi

i have downloaded this plugin for nagios

http://www.toms-blog.com/nagios-hp-msa- ... e-monitor/

i have create this file for service :

define host{
use linux-server ; Name of host template to use
host_name p2000
alias localhost
address 10.0.4.100
}


define service {
host_name p2000
service_description Controller CPU
use generic-service
check_command check_p2000!-c controller -S cpu-load -u "%" -w 60 -C 80!!!!!

}


add this line in nrpe.cfg file

command[check_p2000]=/usr/local/nagios/libexec/check_p2000_api.php

and add this line to command

define command {
command_name check_p2000
command_line $USER1$/check_p2000_api.php -H $HOSTADDRESS$ -U $USER11$ -P $USER12$ $ARG1$
}


but in nagios now show this error

(No output returned from plugin)

why show this error?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Plugin not work correctly

Post by mcapra »

Can you try executing the plugin from the CLI and show us the output?

Code: Select all

/usr/local/nagios/libexec/check_p2000_api.php -H <host> -U <user> -P <pass>
Former Nagios employee
https://www.mcapra.com/
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: Plugin not work correctly

Post by baber »

mcapra wrote:Can you try executing the plugin from the CLI and show us the output?

Code: Select all

/usr/local/nagios/libexec/check_p2000_api.php -H <host> -U <user> -P <pass>

Code: Select all

[root@Nagios libexec]# /usr/local/nagios/libexec/check_p2000_api.php -H 10.0.4.100 -U manage -P manage
OK : Disks 24 OK, Vdisk 1 OK, Temperature 14 OK, Voltage 26 OK, Overall 3 OK, Midplane/Chassis 1 OK, RAID IOM 2 OK, AC Power Supply 2 OK, Enclosures 1 OK
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Plugin not work correctly

Post by mcapra »

Can you verify that the Nagios user and command group have permissions to execute this plugin?

Code: Select all

ls -al /usr/local/nagios/libexec/check_p2000_api.php
Also try the following:

Code: Select all

su nagios
/usr/local/nagios/libexec/check_p2000_api.php -H <host> -U <user> -P <pass>
Former Nagios employee
https://www.mcapra.com/
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: Plugin not work correctly

Post by baber »

mcapra wrote:Can you verify that the Nagios user and command group have permissions to execute this plugin?

Code: Select all

ls -al /usr/local/nagios/libexec/check_p2000_api.php
Also try the following:

Code: Select all

su nagios
/usr/local/nagios/libexec/check_p2000_api.php -H <host> -U <user> -P <pass>

Code: Select all

ls -al /usr/local/nagios/libexec/check_p2000_api.php
-rwxr-xr-x. 1 root root 25799 Mar 16  2014 /usr/local/nagios/libexec/check_p2000_api.php

Code: Select all

[root@Nagios libexec]# su nagios
[nagios@Nagios libexec]$ /usr/local/nagios/libexec/check_p2000_api.php -H 10.0.4.100 -U manage -P manage
OK : Disks 24 OK, Vdisk 1 OK, Temperature 14 OK, Voltage 26 OK, Overall 3 OK, Midplane/Chassis 1 OK, RAID IOM 2 OK, AC Power Supply 2 OK, Enclosures 1 OK,


exactly i use this guide

add this in command.cfg

Code: Select all

define command {

       command_name                             check_p2000
       command_line                             $USER1$/check_p2000_api.php -H $HOSTADDRESS$ -U $USER11$ -P $USER12$ $ARG1$

}


add this service

Code: Select all

define service {

        host_name                       nagios
        service_description             Controller CPU
        use                             generic-service
        check_command                   check_p2000!-c controller -S cpu-load -u "%" -w 60 -C 80!!!!!!!
       }


i think my problem is just for user and pass and ip because i did not insert ip and user and pass where do i have to insert them ?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Plugin not work correctly

Post by mcapra »

Ah, those $USERn$ macros typically need to be set manually in resource.cfg. This file is generally located here:

Code: Select all

/usr/local/nagios/etc/resource.cfg
Try setting the following definitions:

Code: Select all

$USER11$=<username>
$USER12$=<password>
Former Nagios employee
https://www.mcapra.com/
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: Plugin not work correctly

Post by baber »

mcapra wrote:Ah, those $USERn$ macros typically need to be set manually in resource.cfg. This file is generally located here:

Code: Select all

/usr/local/nagios/etc/resource.cfg
Try setting the following definitions:

Code: Select all

$USER11$=<username>
$USER12$=<password>

so thanks

my problem has been solved but i want know if want chk disk on my MSA what do i have to do ? above command can just chk cpu load

Best regards
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Plugin not work correctly

Post by mcapra »

From the plugin's help menu:

Code: Select all

 -c Sets what you want to do
                                status - get the status of the SAN
                                disk - Get performance data of the disks
                                controller - Get performance data of the controllers
                                named-volume - Get the staus of an individual volume - MUST have -n volumename specified
                                named-vdisk - Get the staus of an individual vdisk - MUST have -n volumename specified
                                vdisk - Get performance data of the VDisks
                                volume - Get performance data of the volumes
                                vdisk-write-latency - Get vdisk write latency (only available in later firmwares)
                                vdisk-read-latency - Get vdisk read latency (only available in later firmwares)

We don't have the equipment here to test against.
Former Nagios employee
https://www.mcapra.com/
Locked