Custom_Plugin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
superhero
Posts: 1
Joined: Tue Oct 27, 2020 2:42 am

Custom_Plugin

Post by superhero »

Hello dear community,

I am using Nagios XI to monitor a set of different equipments, everything is working well except one problem. here is it:

- I am monitoring a windows machine with NCPA Agent .in this machine I have a software called KEPServer.
- I have developed a python script which check for me if the licence of one of that software installed on this windows machine is up to date or not.
- My script is named "check_opc.py" and it takes 3 arguments -s $ARG1$ -n $ARG2$ and -v $ARG3$
- My custom plugin is in this client directory C:\Programmes Files\Nagios\NCPA\plugin\.
- in My ncpa.cfg file I have this line

Code: Select all

.py = C:\Python27\python.exe $plugin_name $plugin_args
. So the configuration is all right.

My script is trying to check a licence value as showed in the picture bellow and compared it to a given argument to tell if licence is up to date:
Capture d’écran 2020-10-30 à 11.03.17 AM.png

It must find the value [Allen-bradley ControlLogix Ethernet]

This script works perfectly since I am using check_nrpe with NSClient. But since I have migrated to the NCPA Client I can't perform this check.

When I do a new configuration wizzard, I choose the NCPA agent for Windows and I try to add my script, here is how I proceed.
1.png
I am giving these three arguments:

Code: Select all

-s opc.tcp://127.0.0.1:49320
-n ns=2;s=_System._LicensedFeatures
-v ['Allen-Bradley ControlLogix Ethernet']
Here is what i get after running the configuration :
Capture d’écran 2020-10-30 105902.png
That's mean that the check_ncpa can't compare the third argument of my custom script "[Allen-Bradley ControlLogix Ethernet]" to the value found in the KEPServer software.

I have tried writing my third argument in almost all the ways ( simple quotes, double quotes, without quotes, combined quotes, etc) and nothing seems to be resolving the problem. I think there is a way how the NCPA Agent interpret the string array and has a specific method to give a string array as an argument.

ANY HELP PLEEEEEEEEASE !!!!!!
You do not have the required permissions to view the files attached to this post.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: Custom_Plugin

Post by dchurch »

I don't have access to the source code of your plugin, so I'm not sure what type of check it's doing.

On the surface, it looks like there's spaces inside your brackets inside the value:
60574-spaces.png
Try to see if this works (mind the spaces):

Code: Select all

-s opc.tcp://127.0.0.1:49320
-n ns=2;s=_System._LicensedFeatures
-v '[ Allen-Bradley ControlLogix Ethernet ]'
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Locked