Hi there,
I am having a very odd issue with an active check script. Running the script locally works without problem, running other checks with custom plugins works without problem.
The command is as follows :
$USER1$/check_ncpa.py -H $HOSTADDRESS$ -P 5693 -t sq5vplngs001 -M 'agent/plugin/qt_check_rep_stablequeue' -a "$ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$"
usr/local/nagios/libexec/check_ncpa.py -H targetserver -P 5693 -t nagiosserver -M 'agent/plugin/qt_check_rep_stablequeue' -a "-sPlatformrssd -dPlatform_RSSD -w50 -c60 "
Usage: ncpa_posix_listener [options]
ncpa_posix_listener: error: no such option: -P
why is the posix listener not understanding the flag -s ?
NCPA posix listener error : no such option
Re: NCPA posix listener error : no such option
Can you show us the command (script), run locally from the command line on the remote system, along with the output of it? Also, can you share the "qt_check_rep_stablequeue" script with us?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NCPA posix listener error : no such option
Running locally - i am receiving an error which is expected. At this current time.
script output
-bash-4.2$ ././qt_check_rep_stablequeue
ServerName is required
Usage:././qt_check_rep_stablequeue -s<ServerName> -d<DatabaseName> -w<warning threshold> -c<critical threshold>
script with variables
-bash-4.2$ ./qt_check_rep_stablequeue -sPlatformrssd -dPlatform_RSSD -w40 -c50
ERROR: Unable to ISQL into server Platformrssd from function getQueueSize
I need to check with the DB team if i can post the script.
script output
-bash-4.2$ ././qt_check_rep_stablequeue
ServerName is required
Usage:././qt_check_rep_stablequeue -s<ServerName> -d<DatabaseName> -w<warning threshold> -c<critical threshold>
script with variables
-bash-4.2$ ./qt_check_rep_stablequeue -sPlatformrssd -dPlatform_RSSD -w40 -c50
ERROR: Unable to ISQL into server Platformrssd from function getQueueSize
I need to check with the DB team if i can post the script.
Re: NCPA posix listener error : no such option
Many factors can be at play here, i.e. how is your script written, are you passing your args as one argument or as separate arguments, do you need to escape special characters, what version of NCPA you are using, etc.
Here's a very simple example of passing 4 args to a PS script.
4args.ps1 script
Running the script locally
In the web UI (API Endpoint) From the CLI on the Nagios XI server
Hope this helps.
Here's a very simple example of passing 4 args to a PS script.
4args.ps1 script
Code: Select all
$ServerName = "-s"+$args[0]
$DatabaseName = "-d"+$args[1]
$Warning = "-w"+$args[2]
$Critical = "-c"+$args[3]
write-host "Arguments are: $ServerName $DatabaseName $Warning $Critical"
exit 0Running the script locally
Code: Select all
PS C:\Program Files (x86)\Nagios\NCPA\plugins> .\4args.ps1 myserver mydb 5 10
Arguments are: -smyserver -dmydb -w5 -c10
PS C:\Program Files (x86)\Nagios\NCPA\plugins>In the web UI (API Endpoint) From the CLI on the Nagios XI server
Code: Select all
[root@main-nagios-xi ~]# /usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.x -t 'mytoken' -M 'plugins/4args.ps1/myserver/mydb/5/10'
Arguments are: -smyserver -dmydb -w5 -c10
[root@main-nagios-xi ~]#
[root@main-nagios-xi ~]# /usr/local/nagios/libexec/check_ncpa.py -H 192.168.x.x -t 'mytoken' -M 'plugins/4args.ps1' -a "myserver mydb 5 10"
Arguments are: -smyserver -dmydb -w5 -c10
[root@main-nagios-xi ~]#You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!