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
NCPA Plugin process filtering with regualr expressions
-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
-
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
At least in the current version you can, not sure when it was added
try
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'-
nagiosEngie
- Posts: 104
- Joined: Thu May 03, 2018 7:57 am
Re: NCPA Plugin process filtering with regualr expressions
Hi,
works like a beauty.
Thanks
Sandro
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
Great!
Locking thread
Locking thread