KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

keeping RMA running

 
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX
View previous topic :: View next topic  
Author Message
voor



Joined: 27 Apr 2007
Posts: 6

PostPosted: Fri Apr 27, 2007 5:16 pm    Post subject: keeping RMA running Reply with quote

I would like to make sure that RMA is always running on my servers and restart it if it died or has been killed for some reason. For other programs that generate a <program>.pid file like syslogd, I can do this in crontab by reading the PID from the file and then checking the process table. Is there any option to make RMA save its PID to a file in a similar manner?
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12793
Location: USA

PostPosted: Fri Apr 27, 2007 5:24 pm    Post subject: Reply with quote

Probably we can implement such option in next version

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
voor



Joined: 27 Apr 2007
Posts: 6

PostPosted: Fri Apr 27, 2007 5:51 pm    Post subject: Reply with quote

That would be great, looking forward to it!
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12793
Location: USA

PostPosted: Tue May 08, 2007 8:26 pm    Post subject: Reply with quote

Done. RMA 1.25 available for download at http://www.ks-soft.net/hostmon.eng/downpage.htm#unix

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
voor



Joined: 27 Apr 2007
Posts: 6

PostPosted: Wed May 16, 2007 8:00 pm    Post subject: Reply with quote

Works perfectly, thanks!
Back to top
View user's profile Send private message
voor



Joined: 27 Apr 2007
Posts: 6

PostPosted: Mon May 21, 2007 7:03 pm    Post subject: Reply with quote

If anyone is interested, this 'rmachk' Bourne shell script is what I use to check whether RMA is running. If it's not running, then the script will start it and redirect the startup output to /dev/null. Much of the code was shamelessly borrowed from psybncchk. The RMA client must be version 1.25 or higher and the PidFile line in rma.ini must be uncommented.

Code:
#!/bin/sh

# assume the 'rma' executable is at /rma/rma and the PID file is at /var/run/rma.pid

RMAPATH=/rma
RMAPIDPATH=/var/run

# if 'kill -CHLD' is not recognized by the OS (like Solaris), try 'kill -CLD' instead

if test -r $RMAPIDPATH/rma.pid; then
    RMAPID=`cat $RMAPIDPATH/rma.pid`
    if `kill -CHLD $RMAPID >/dev/null 2>&1`
    then
        exit 0
    fi
fi
cd $RMAPATH
./rma rma.ini > /dev/null 2>&1


And this crontab entry tells cron to run rmachk every minute:

Code:
* * * * * /rma/rmachk > /dev/null 2>&1
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12793
Location: USA

PostPosted: Tue May 22, 2007 8:45 am    Post subject: Reply with quote

Thank you for contribution

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> RMA for UNIX All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index