Process Monitoring for EITHER syslogd OR rsyslogd (795 Views)
Reply
Honored Contributor
David Gerrish
Posts: 1,740
Registered: ‎09-04-2000
Message 1 of 10 (795 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

 

protocolsoftware.com
HP Expert
Ramkumar Devanathan
Posts: 1,675
Registered: ‎07-31-2002
Message 2 of 10 (779 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!
Valued Contributor
gope
Posts: 51
Registered: ‎09-05-2005
Message 3 of 10 (766 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 !!!
Honored Contributor
David Gerrish
Posts: 1,740
Registered: ‎09-04-2000
Message 4 of 10 (759 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

protocolsoftware.com
Honored Contributor
David Gerrish
Posts: 1,740
Registered: ‎09-04-2000
Message 5 of 10 (480 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

[ Edited ]

 

I also have a similar issue with solaris 5.9 servers:

 

We monitor /usr/lib/inet/inetd as standard on solaris servers, but on Solaris 5.9 it seems to be /usr/sbin/inetd.

 

There doesn't seem to be an easy way to do this which is crazy.

 

Previous OM8 would be fine, we could just monitor /inetd for example.

 

It seems in OM9 I have to write a script instead!

 

Regards,

Dave

 

protocolsoftware.com
Honored Contributor
KAKA_2
Posts: 1,482
Registered: ‎05-26-2007
Message 6 of 10 (475 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

Hi David,

I had to face exactly same problem as you while monitoring LINUX nodes and i wrote an policy based on perl script.

-KAKA-
Honored Contributor
David Gerrish
Posts: 1,740
Registered: ‎09-04-2000
Message 7 of 10 (474 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

Thanks KAKA - awful isn't it ?!

 

I just don't understand how you can go from OM8 to OM9 and make so many things worse.

 

Cheers

Dave

protocolsoftware.com
Honored Contributor
KAKA_2
Posts: 1,482
Registered: ‎05-26-2007
Message 8 of 10 (472 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

Dave - No doubt in that.
So far only answer i have got from HP is "keep silent".

-KAKA-
HP Expert
Ramkumar Devanathan
Posts: 1,675
Registered: ‎07-31-2002
Message 9 of 10 (462 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

Guys, what's the complaint? that the standard policy does not support regex?

 

will write up something and share in the next couple of days.

 

- ramd

HP Software Rocks!
Honored Contributor
David Gerrish
Posts: 1,740
Registered: ‎09-04-2000
Message 10 of 10 (459 Views)

Re: Process Monitoring for EITHER syslogd OR rsyslogd

Hi Ram,

 

It's the fact that you can't do something so trivially simple that you could do in OM8, that's what's frustrating.

 

Cheers

Dave

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