Monitoring a predefinite number of the same process running on a system
Albook 120000625S Visits (6014)
I think most of you already dealt with scenarios where you had to control the availability
To help with processes having command line length exceeding 768 characters, in Unix and Linux OS agent you also
This is clearly explained on many technotes and dwanswer entries like:
and in many other articles, so we are not going to discuss about it any further.
It can happen you need instead to take under control the exact number of process instances running on the system.
Let's suppose you want to be sure that the number of Java processes running on the system is always 3, because this is the number of application servers
If you look at the available attributes into Process attribute group, you will notice one attribute called "Process Count" (Linux) / Count of Processes (Unix).
It returns the count of processes with the same name, so you might thing you could create a situation like:
( SCAN(Command Line) == 'java' AND Process Count != 3)
But actually this will not work.
For Process Count, the name of the process is selected by using the Command Line attribute, that usually in Java processes is most of the time unique, because of differences in
We can use Process Count only if the Command Line value is exactly the same for all the process instances.
So let's forget about Process Count (or Count of processes in Unix) in this specific context scenario. It will not help us.
A possible solution would be a formula like:
( SCAN(Command Line) == 'java' AND COUNT(Process Command Name) != '3')
With the SCAN function we select only the rows that includes string "java", and then we use COUNT function on one of the available attributes (it does not matter which one, you can choose anyone)
to know how many rows matched the previous function.
In this way the situation will fire exactly when the number of java processes running on the server will be different than 3.
Hope it helps
Subscribe and follow us for all the latest information directly on your social feeds: