Page 1 of 1

Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Wed Feb 04, 2015 3:44 pm
by mdpeiretti
Hi, i have just installed a new nagios in my company and i am trying to monitor sap enviroments ( i have done this in the past with previous releases of nagios with any problem)


Now i am having trouble with 2 different plugins (both where used in the past with any issues)


# Commands definition
check_sap
check_sapnew (new version of the previous plugin)

Code: Select all

# 'check_sap' command definition

define command{
        command_name    check_sap
        command_line    $USER1$/check_sap $ARG1$ $ARG2$
        }

define command{
        command_name    check_sapnew
        command_line    $USER1$/check_sapnew $ARG1$ $ARG2$ $ARG3$
        }
Permissions

Code: Select all

[nagios@sapnagios libexec]$ ls -lrt check_sapnew
-rwxrwxrwx 1 nagios nagios 35112 nov 19 15:38 check_sapnew
[nagios@sapnagios libexec]$ ls -lrt check_sap
-rwxrwxrwx 1 nagios nagios 9836 nov 19 16:46 check_sap
[nagios@sapnagios libexec]$
Usage for check_sap:

Code: Select all

[nagios@sapnagios libexec]$ pwd
/usr/local/nagios/libexec
[nagios@sapnagios libexec]$ check_sap
Agent

Syntax: check_sap <Template> <RFC-Template>

       <Template> defined in /etc/sapmon/agent.cfg
       <RFC-Template> defined in /etc/sapmon/login.cfg
Usage for check_sapnew:

Code: Select all

[nagios@sapnagios libexec]$ check_sapnew
Not enough parameters
Usage: check_sapnew <options> <Monitor Set> [<Monitor Name> [<Item>]]

 where
  --host|-h		SAP Hostname
  --user|-u		SAP RFC user
  --pass|-p		Password for this user
  --client|-c		Client (default 000)
  --sysnr|-s		System number (default 00)
  --lang|-l		Language (default E)
  --trace|-t		Create .trc file in working directory
  -2			Use Version 2
  --dest|-d		SAP Destination (V2)
  --gateway|-g		SAP Gateway (V2)
  --gwserv|-g		SAP Gateway Server (V2 - defaults to sapgwxx where xx is the sysnr)

  --fullpath|-f		Match against the full path of the Object (Separator is / )
  --trim		Remove this number of leading parts from the performance data (useful with fullpath)
  --thresholds		Include the SAP thresholds in the perf data (simplified)
  --use-ranges		Include the SAP thresholds in the perf data (range format)

  --mode|-m		Being one of: listsets listmonitors sapinfo listtree
Executions for both plugins from /usr/local/sap/libexec/ with nagios user (other plugins from the same directory work ok)

check_sap

Code: Select all

[nagios@sapnagios libexec]$ ./check_sap 001 HAP
Concurrent Users (Client 300)=83Usrs | Concurrent Users (Client 300)=83Usrs;1999999997.000000;1999999997.000000;0;
[nagios@sapnagios libexec]$
check_sapnew

Code: Select all

[nagios@sapnagios libexec]$ ./check_sapnew -h /H/164.77.255.236/S/3299/H/10.40.10.135 -u ***** -p ***** -c 300 -s 01 nagios nagios Concurrent Users
[OK] SAP/Concurrent Users (Client 300): 83 Usrs | Concurrent_Users_(Client_300)=83Usrs
[nagios@sapnagios libexec]$
Service Denitions for both plugins, and a port check with standar plugin

Code: Select all

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       Sc_SAPROUTER
        service_description             SAPRouter  Port
        check_command                   check_tcp!3299
        }

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       Sc_SAPROUTER
        service_description             Concurrent Users check_sap
        check_command                   check_sap!001!HAP
        }
define service{
        use                             generic-service         ; Name of service template to use
        host_name                       Sc_SAPROUTER
        service_description             Concurrent Users check_sapnew
        check_command                   check_sap!-h /H/164.77.255.236/S/3299/H/10.40.10.135 -u **** -p ****!-c 300 -s 01!nagios nagios Concurrent Users
        }
The error - Nagios Web interface

Image
Nagios Web interface
Nagios Web interface
doble and triple checked permisions, tryed with full paths in commands definition, tryed with full command in command definition and no ARGs,
I have Installed Nagios 3.5, then upgraded to lasted stable 4.08, but the error persists

I have search the forums and i have found a similar issue in this thread http://support.nagios.com/forum/viewtop ... 45&p=28142, but no solution was provided.

any ideas ?

thanks in advance and sorry for my english
best regards!

Re: Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Wed Feb 04, 2015 10:09 pm
by Box293
There is plenty of information here and it looks like everything is configured correctly.

Can you try this:

Code: Select all

define command{
        command_name    check_sap_test
        command_line    /usr/local/nagios/libexec/check_sap 001 HAP
        }

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       Sc_SAPROUTER
        service_description             Concurrent Users check_sap TEST
        check_command                   check_sap_test
        }

Re: Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Thu Feb 05, 2015 12:14 am
by mdpeiretti
Hi Thanks box293 !I have already tryed that but same error! With both plugins, :(

Re: Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Thu Feb 05, 2015 2:08 pm
by tgriep
I did see one error for your "Concurrent Users check_sapnew" check.

The check that you defined

Code: Select all

check_command                   check_sap!-h /H/164.77.255.236/S/3299/H/10.40.10.135 -u **** -p ****!-c 300 -s 01!nagios nagios Concurrent Users
should be

Code: Select all

check_command                   check_sapnew!-h /H/164.77.255.236/S/3299/H/10.40.10.135 -u **** -p ****!-c 300 -s 01!nagios nagios Concurrent Users
Can you provide the plugin you are using so we can test it?

Re: Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Mon Feb 09, 2015 1:17 pm
by mdpeiretti
hi tgriep, i fixed that, but still having the same error

tnks!

Re: Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Mon Feb 09, 2015 6:46 pm
by Box293
tgriep wrote:Can you provide the plugin you are using so we can test it?

Re: Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Wed Feb 11, 2015 8:24 am
by mdpeiretti
Hi, here are the plugins and the RFC SDK with the libraries needed to connect to the system


https://mega.nz/#F!AoY0GCjL!esgDMeBG9QpPUlMb5s9pWQ

tnks!

Re: Nagios SAP CCMS PLUGIN - 127 is out of bounds

Posted: Wed Feb 11, 2015 11:13 am
by scottwilkerson
I would think you need to put quotes around the host because the forward slashes not quoted will be looking for a file...

e.g.

Code: Select all

check_command                   check_sapnew!-h "/H/164.77.255.236/S/3299/H/10.40.10.135" -u **** -p ****!-c 300 -s 01!nagios nagios Concurrent Users