RMA will not restart apache

Remote Monitoring Agent for Linux, FreeBSD, and other UNIX-like platforms.
Post Reply
mos-eisley
Posts: 76
Joined: Wed Mar 21, 2007 5:51 am
Location: Klarup (AAlborg), Demark

RMA will not restart apache

Post by mos-eisley »

I have a Debian system with an apache and RMA running (well).

A process check check for apache processes, and if this fails, it should execute an Action Profile "RestartLinuxApache", with contains the action "Execute external program", with these attributes:

Image

The Command Line being:

/etc/init.d/apache stop;sleep 5;/etc/init.d/apache start

When I kill the apache process to test, I see this in the syslog:

25-04-2007 12:31:37 Action "Execute external program" executed by RMA "pai05500-1.vfnz.a.p"

But the apache never restarts on the server...why?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I think, you should create simple script file, e.g. restart_apache.sh, and specify that particular script name into "Command line box", like: /opt/custom/restart_apache.sh

The body of the restart_apache.sh:

Code: Select all

#!/bin/sh

/etc/init.d/apache stop;
sleep 5;
/etc/init.d/apache start
Regards,
Max
mos-eisley
Posts: 76
Joined: Wed Mar 21, 2007 5:51 am
Location: Klarup (AAlborg), Demark

Post by mos-eisley »

Well, that works - just ¤#%&#¤&&%¤ me off that I need to create, maintain, distribute and execute multiple commands ( e.g. scripts) that way :(
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Sorry, RMA is unable to perform several commands in one line.

Regards,
Max
mos-eisley
Posts: 76
Joined: Wed Mar 21, 2007 5:51 am
Location: Klarup (AAlborg), Demark

Post by mos-eisley »

Well, this worked:

/etc/init.d/apache restart

Still, multicommand support would be prefered :o
Post Reply