Pages: [1]   Go Down
Author Topic: Issues with generic_proc agent  (Read 163 times)
0 Members and 2 Guests are viewing this topic.
siskos
Newbie
*

Karma: 0
Offline Offline

Posts: 2


View Profile
« on: January 04, 2012, 12:01:49 PM »

Hello,

I use the module_type generic_proc to see if a necessary process on our server is still running.

module_begin
module_name wwwstartsrv
module_type generic_proc
module_exec ps aux | grep -c [w]wwstartsrv
module_end

Everything seems ok and in the console I get that 1 process is running.

Now if the process is stopped I don't get any mention of it in the console? Only the "last contact" keeps counting?
When I look into the xml of the agent (debug = 1) I also see that the module "wwwstartsrv" is actually not in the xml?

When I run ps aux | grep -c [w]wwstartsrv manully i get 1 (if running) or 0 (not running).

If the process is started again it the "last contact" is updated along with the other modules, and the module is also back in de xml file.

Thanks! :)
Logged

alumbreras
Sr. Member
****

Karma: 5
Offline Offline

Posts: 108


View Profile
« Reply #1 on: January 05, 2012, 08:17:49 AM »

Hi Siskos
good morning


Can you try these command? is a little bit different.

Code:
ps -Af | grep smsd | grep -v "grep" | wc -l

the first grep shows you all process that contains a word smsd (the deamon of smstools). the second grep excludes the current command line, and the third counts the lines.

i've got these command for various modules and i have no problem.

bye!

Logged

siskos
Newbie
*

Karma: 0
Offline Offline

Posts: 2


View Profile
« Reply #2 on: January 05, 2012, 06:52:28 PM »

Thanks alumbreras , on first sight this change seems to work.

Very strange, is there any way to figure out why my short line doesn't work?
Perhaps some kind of debugging?

Logged

tpalacios
Administrator
Sr. Member
*****

Karma: 8
Offline Offline

Posts: 190


The Game


View Profile
« Reply #3 on: January 06, 2012, 10:05:07 PM »

Perhaps it doesn't like the brackets... try "[w]wwstartsrv" or something to escape these characters.

Regards.
Logged

Pages: [1]   Go Up
Print
 
Jump to:  


SourceForge.net Logo  This site is monitored by Pandora FMS   ArticaST