NCPA Plugin process filtering with regualr expressions

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagiosEngie
Posts: 104
Joined: Thu May 03, 2018 7:57 am

NCPA Plugin process filtering with regualr expressions

Post by nagiosEngie »

Hello Nagios Crew,

Is it possible to search for processes (with NCPA plugin) on linux server using regular expressions like:
.*svr worker.*PIPPO_PLUTO.*
EX:
./check_ncpa.py -H 10.211.145.47 -t 'TOKEN' -P 5693 -M 'processes' -q 'cmd=.*svr worker.*PIPPO_PLUTO.*'

The processes I am trying to capture have commas in the name, so I cannot use the "cmd=" option (which expects the whole command Line launched by the process) because in html commas are special characters so when the script generates the URL for the API request I will get an error.
The only option I can come up with is to use regular expressions.

Can you please help?

Thanks
Sandro
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NCPA Plugin process filtering with regualr expressions

Post by scottwilkerson »

At least in the current version you can, not sure when it was added
try

Code: Select all

./check_ncpa.py -H 10.211.145.47 -t 'TOKEN' -P 5693 -M 'processes' -q 'cmd=.*svr worker.*PIPPO_PLUTO.*,match=regex'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
nagiosEngie
Posts: 104
Joined: Thu May 03, 2018 7:57 am

Re: NCPA Plugin process filtering with regualr expressions

Post by nagiosEngie »

Hi,
works like a beauty.
Thanks
Sandro
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NCPA Plugin process filtering with regualr expressions

Post by scottwilkerson »

Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked