NagiosEnterprises/ncpa

NCPA error on Nagios Core

GolfTitan1 opened this issue · 6 comments

NCPA works fine from command line.

Nagios runs fine on all other checks for services.
Only NCPA checks are erroring out.

Errors on Nagios Core interface on checks.
(No output on stdout) stderr: /bin/sh: 1: Syntax error: Unterminated quoted string

Can you show your Core configs regarding NCPA?

Aaron Added me! NCPA

define command {
command_name check_ncpa
command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$
}

Command works from CLI with no issues.

./check_ncpa.py -H 10.0.0.170 -t 'Password!' -M 'system/uptime' --warning 3456000 --critical 5184000

OK: Uptime was 14 days 20 hours 56 minutes 54 seconds | 'uptime'=1285014.06s;3456000;5184000;

Nagios WebUI Alerts error
checks

Your shell might be interpreting the ! character as a special character. Have you tried escaping the ! with a \? (-t 'Password\!')
You could also use double quotes ("Password!")

What's the command definition for one of the service checks? I assume you're using "check_ncpa" as the command, but the other commands you're using imply you're using more than one argument, but only define one argument for the command.

FYI...I wouldn't recommend having your token be defined in the check, unless you have unique tokens for a given service check.

You're better off defining that as a constant that's referenced directly in your command definition. Again, depends on how you use tokens.

For example:

define command {

    command_name        check_ncpa
    command_line        $USER2$/check_ncpa.py -t $USER3$ -H $HOSTADDRESS$ -M $ARG1$ $ARG2$

}