So a client asked today how he could monitor all the processes using the processes probe but exclued just some.
You can do this using regex:
When I now test this I see all processes running on my linux server excluding HTTPD and SSHD
Thought I would share that one
I'm not sure that would work on all platforms. I tested this quickly on a Linux box and it didn't work for me. In my experience depending on regex engine being used it differs, not sure how processes works (although nimsoft is usually Perl compliant).
I had to do /[^httpd]/ to have everything except httpd in processes probe. From experience I know that in c# it would be "(?!*.httpd)". It seems to me especially lookahead and lookbehind functions depend on the engine.
What exactly is the goal of monitoring all of the processes? If you are trying to make sure they are all running, this profile will not work because when one of the processes stops, all of the other ones are still running and match the profile. If you are try to collect QoS, it seems like most of the aggregated numbers are not going to be all that useful. But maybe I am missing an option that would be helpful. If you can explain more about the purpose of the monitoring, I might be able to understand the solution more clearly.
I guess you could be looking for a process with too many instances, but want to exclude sshd/httpd as they spawn multiple instances. Another example may be to check no process eats too much CPU, but exclude a particular one that you know is always CPU intensive.
I think checking the instance count in a profile that matches almost all processes would actually check the total instances of all of the matching processes rather than the number of instances of each process. So it would not be able to identify an individual process with too many instances.
Similarly, a CPU check in that profile would probably be checking usage across all of the matching processes rather than of each process. Maybe there are some cases where it might be useful to check the aggregated CPU usage value while excluding certain processes; I am curious if that is what was needed by this customer.
you are right about the instances. The count sums all procs that pass the pattern match. Not much use.
The CPU one does work though, I often use it. If you make a profile with
cpu_max = nn
scan_cpu_usage = yes
and leave the proc name blank, then it will alert individualy on each proc that exceeds nn% use.
Retrieving data ...