01-07-2014 09:31 AM
I am trying to do something really simple here, but can't get it to work in OM9.
I am trying to monitor the syslog daemon on linux servers but I have been told the daemon is called "syslogd" on some servers and "rsyslogd" on others.
In OM8 the process monitoring was less strict, in that it simply did the equivalent of a "ps -ef | grep <process>", which would work here.
The adminui seems to take the process I have defined (syslogd) literally, and returns a FAILURE alert on servers running rsyslogd.
I have tried using a program option, using something like <`ps -ef | grep syslogd | grep -v grep | echo $?`> but that complains about newline characters.
I know I could write a script to do this but that would be painful for something so simple.
Any help would be much appreciated.
01-07-2014 07:35 PM
Next, your need being a bit more than the vanilla offering let's add the toppings..
That said, you could create your own script as suggested above, or build on top of what's already available.
What you need is to apply conditionality, to check which process to monitor - syslogd or rsyslogd. for this you need access to the policy internal code - here's how.
You can make modifications on the code that's used in the process monitoring policy. Here's the trick to view the code within the policy - it is 'abstracted' by the policy editor UI but there's a hack to get it working.
1. Create a policy in the normal manner via OM console, set your thresholds for cpu usage, etc.
2. Deploy the policy to a node.
3. The policy is deployed to OvDataDir/conf/policies/monitor folder.
4. pick up the data file for the policy - you would need to know the policy version UUID to match the right file.
5. scp/ftp/copy the policy to your OM server. upload the policy (data) file using either importpolicies command (OMW) or opcpolicy (OMU/L/S).
6. once the policy is uploaded, now open the policy in the policy editor - you have the policy with its internal code.
Have a look at the code and make modifications to suit your need.
01-07-2014 11:08 PM
Regular expression cannot be used in Process Name of "serivce/process" monitor policy in OM9.
And as you mentioned , service/process monitor policy does check for exact string.
You might either create 2 separate policies ( service/process monitor ) and deploy accordingly to the servers or create a script that does check for the presence of either of the process.
Hope this helps.
To show your appreciation, click KUDOS !!!
01-08-2014 12:23 AM
You can't use wildcards for process names unfortunately. Shame you can't just use pattern matching as you can do with with the parameters field.
Thanks Gope - that's what I thought - I know I can write a script but this just seemed too ridiculous to contemplate considering the simplicity of whaty I am trying to achieve.
I realise I can have 2 monitors, but that would mean classifying servers accordingly, which would be an admin headache and a pain to manage in future, so that's not an option.
I think I will just write a script - crazy as it seems...
www.protocolsoftware.com - We Monitor IT