Re: Process Monitoring for EITHER syslogd OR rsyslogd (89 Views)
Reply
Honored Contributor
David Gerrish
Posts: 1,730
Registered: ‎09-04-2000
Message 1 of 4 (118 Views)

Process Monitoring for EITHER syslogd OR rsyslogd

Hi,

 

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.

 

Regards

David Gerrish

 

Please use plain text.
Honored Contributor
Ramkumar Devanathan
Posts: 1,531
Registered: ‎07-31-2002
Message 2 of 4 (102 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

David, did you consider/attempt using a wildcard approach for the process name? any success or problems encountered here?

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.
HP Software Rocks!
Please use plain text.
Valued Contributor
gope
Posts: 48
Registered: ‎09-05-2005
Message 3 of 4 (89 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

Hello David,

 

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.

 

Best Regards,
Gopinath Manickam

To show your appreciation, click KUDOS !!!
Please use plain text.
Honored Contributor
David Gerrish
Posts: 1,730
Registered: ‎09-04-2000
Message 4 of 4 (82 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

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...

 

Thanks

Dave

 

www.protocolsoftware.com - We Monitor IT

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation