Xymon Mailing List Archive search

auto-restart clients

8 messages in this thread

list Kevin Hanrahan · Sat, 23 Apr 2005 11:41:15 -0400 ·
Hello all,
 For reasons which I cannot understand, our unix admins feel the need to
reboot their machines constantly. I don't think there is an uptime
exceeding 2 weeks!! However when that happens, the BB client stops
reporting and I eventually get the purple alerts from Hobbit. Can
someone tell me how to get the clients to auto-restart? Also, I am not a
coder so please don't tell me to "write a script to make them start at
reboot" because that is obvious....i just don't know how. Thank you for
all input on this.

kevin
list Henrik Størner · Sat, 23 Apr 2005 17:52:29 +0200 ·
quoted from Kevin Hanrahan
On Sat, Apr 23, 2005 at 11:41:15AM -0400, kevin hanrahan wrote:
 For reasons which I cannot understand, our unix admins feel the need to
reboot their machines constantly. I don't think there is an uptime
exceeding 2 weeks!! However when that happens, the BB client stops
reporting and I eventually get the purple alerts from Hobbit. Can
someone tell me how to get the clients to auto-restart? Also, I am not a
coder so please don't tell me to "write a script to make them start at
reboot" because that is obvious....i just don't know how. Thank you for
all input on this.
Normally a script like this would suffice:

#!/bin/sh

case "$1" in
  "start")
	su -c "/usr/local/bb/bbc/runbb.sh start" bb
	;;

  "stop")
	su -c "/usr/local/bb/bbc/runbb.sh stop" bb
	;;
esac

exit 0


Now the trick is to get that script run automatically when the system
starts up. How you do that depends on the Unix flavour - often the
script is installed in /etc/init.d/bigbrother, and then you need to
create links from /etc/rc2.d/S99bigbrother -> /etc/init.d/bigbrother

Regards,
Henrik
list John Turner · Sat, 23 Apr 2005 11:53:23 -0400 ·
quoted from Kevin Hanrahan
On Apr 23, 2005, at 11:41 AM, kevin hanrahan wrote:
Hello all,
 For reasons which I cannot understand, our unix admins feel the need to
reboot their machines constantly. I don't think there is an uptime
exceeding 2 weeks!! However when that happens, the BB client stops
reporting and I eventually get the purple alerts from Hobbit. Can
someone tell me how to get the clients to auto-restart? Also, I am not a
coder so please don't tell me to "write a script to make them start at
reboot" because that is obvious....i just don't know how. Thank you for
all input on this.

kevin

Here is the script we use. This one is from a Linux machine and you will need to set BBHOME and BBUSER. Under Linux you can use the chkconfig command to add this. Under other OSes you will need to link it to the run levels you want it to start/stop. Any UNIX administrator should be able to do this or you are paying them too much.

John

% more /etc/init.d/bb

#!/bin/sh
#
# chkconfig: 345 89 19
# description: Start up script for Big Brother
#
# Big Brother Startup

PATH=$PATH:/bin:/usr/bin                # FOR su
BBHOME=/opt/bb/bb
BBUSER=bb

case "$1" in
start)
         su - $BBUSER -c "cd $BBHOME;./runbb.sh start"
         echo "Starting Big Brother."
         #&SLEEP
         ;;
restart)
         su - $BBUSER -c "cd $BBHOME;./runbb.sh restart"
         echo "Restarting Big Brother."
         #&SLEEP
         ;;
stop)
         su - $BBUSER -c "cd $BBHOME;./runbb.sh stop"
         echo "Stopping Big Brother."
         ;;
*)
         echo "Usage: $0 {start|stop|restart}"
         exit 1
         ;;
esac

exit 0
list Lars Ebeling · Sat, 23 Apr 2005 18:03:27 +0200 (CEST) ·
quoted from Henrik Størner

Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote: 


Now the trick is to get that script run automatically when the system
starts up. How you do that depends on the Unix flavour - often the
script is installed in /etc/init.d/bigbrother, and then you need to
create links from /etc/rc2.d/S99bigbrother -> /etc/init.d/bigbrother


If you are running HP_UX replace /etc with /sbin

Link with:

ln -s /etc/init.d /bigbrother /etc/rc2.d/S99bigbrother   

Regards

Lars


Hobbithobbyist

"If you run UNIX and you don't have a UPS, you should see a psychiatrist...."
--Byte Magazine (years ago)
list Kevin Hanrahan · Sat, 23 Apr 2005 12:29:35 -0400 ·
Gentlemen,
 Thank you for the responses. I should have mentioned that most of the
machines are solaris and a few are AIX
quoted from John Turner

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Saturday, April 23, 2005 11:52 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] auto-restart clients


On Sat, Apr 23, 2005 at 11:41:15AM -0400, kevin hanrahan wrote:
 For reasons which I cannot understand, our unix admins feel the need 
to reboot their machines constantly. I don't think there is an uptime 
exceeding 2 weeks!! However when that happens, the BB client stops 
reporting and I eventually get the purple alerts from Hobbit. Can 
someone tell me how to get the clients to auto-restart? Also, I am not 
a coder so please don't tell me to "write a script to make them start 
at reboot" because that is obvious....i just don't know how. Thank you 
for all input on this.
Normally a script like this would suffice:

#!/bin/sh

case "$1" in
  "start")
	su -c "/usr/local/bb/bbc/runbb.sh start" bb
	;;

  "stop")
	su -c "/usr/local/bb/bbc/runbb.sh stop" bb
	;;
esac

exit 0


Now the trick is to get that script run automatically when the system starts
up. How you do that depends on the Unix flavour - often the script is
installed in /etc/init.d/bigbrother, and then you need to create links from
/etc/rc2.d/S99bigbrother -> /etc/init.d/bigbrother

Regards,
Henrik


Note:  The information contained in this email and in any attachments is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material.  Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other than the
intended recipient is prohibited.  The recipient should check this email and
any attachments for the presence of viruses.  Sender accepts no liability
for any damages caused by any virus transmitted by this email. If you have
received this email in error, please notify us immediately by replying to
the message and delete the email from your computer.  This e-mail is and any
response to it will be unencrypted and, therefore, potentially unsecure.
Thank you.  NOVA Information Systems, Inc.
list Al Jeffcoat · Sat, 23 Apr 2005 13:06:38 -0400 ·
For our AIX servers, we have an /etc/rc.local script that starts things
on startup.  In that script, we have the following command:

su - bbuser -c "/path/to/bbclient/runbb.sh start"

(If you create that script new, then make sure to make it executable,
chmod +x /etc/rc.local)

And then execute the following command:

mkitab "local:2:once:/etc/rc.local 2>&1 > /utils/logs/rc.local.output"

This will create an entry in the /etc/inittab file for the rc.local
file.  Any output from that script gets created in
/utils/logs/rc.local.output, it's useful to see if something isn't
working right.

And I have the same issue here, we have some servers that the app is so
badly written that we have to reboot weekly.  We also have others whose
uptime is 300+ days.

Hope that helps,

Al Jeffcoat
IBM Certified Support Specialist, AIX
Enterprise SAN and Storage Administrator
System Programmer II
quoted from Kevin Hanrahan


-----Original Message-----
From: user-fd47fec4b039@xymon.invalid [mailto:user-fd47fec4b039@xymon.invalid] 
Sent: Saturday, April 23, 2005 12:30 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: RE: [hobbit] auto-restart clients

Gentlemen,
 Thank you for the responses. I should have mentioned that most of the
machines are solaris and a few are AIX

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Saturday, April 23, 2005 11:52 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] auto-restart clients


On Sat, Apr 23, 2005 at 11:41:15AM -0400, kevin hanrahan wrote:
 For reasons which I cannot understand, our unix admins feel the need 
to reboot their machines constantly. I don't think there is an uptime 
exceeding 2 weeks!! However when that happens, the BB client stops 
reporting and I eventually get the purple alerts from Hobbit. Can 
someone tell me how to get the clients to auto-restart? Also, I am not
a coder so please don't tell me to "write a script to make them start 
at reboot" because that is obvious....i just don't know how. Thank you
for all input on this.
Normally a script like this would suffice:

#!/bin/sh

case "$1" in
  "start")
	su -c "/usr/local/bb/bbc/runbb.sh start" bb
	;;

  "stop")
	su -c "/usr/local/bb/bbc/runbb.sh stop" bb
	;;
esac

exit 0


Now the trick is to get that script run automatically when the system
starts
up. How you do that depends on the Unix flavour - often the script is
installed in /etc/init.d/bigbrother, and then you need to create links
from
/etc/rc2.d/S99bigbrother -> /etc/init.d/bigbrother

Regards,
Henrik


Note:  The information contained in this email and in any attachments is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material.  Any review,
retransmission, dissemination or other use of, or taking of any action
in
reliance upon, this information by persons or entities other than the
intended recipient is prohibited.  The recipient should check this email
and
any attachments for the presence of viruses.  Sender accepts no
liability
for any damages caused by any virus transmitted by this email. If you
have
received this email in error, please notify us immediately by replying
to
the message and delete the email from your computer.  This e-mail is and
any
response to it will be unencrypted and, therefore, potentially unsecure.
Thank you.  NOVA Information Systems, Inc.


This e-mail message and any attached files are confidential and are intended solely for the use of the addressee(s) named above. If you are not the intended recipient, any review, use, or distribution of this e-mail message and any attached files is strictly prohibited. This communication may contain material protected by Federal privacy regulations, attorney-client work product, or other privileges. If you have received this confidential communication in error, please notify the sender immediately by reply e-mail message and permanently delete the original message.  To reply to our email administrator directly, send an email to:  user-ecde3bbc361d@xymon.invalid .  If this e-mail message concerns a contract matter, be advised that no employee or agent is authorized to conclude any binding agreement on behalf of Orlando Regional Healthcare by e-mail without express written confirmation by an officer of the corporation. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of Orlando Regional Healthcare.
list Lars Ebeling · Sun, 24 Apr 2005 08:00:51 +0200 (CEST) ·
quoted from Al Jeffcoat

Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
Now the trick is to get that script run automatically when the system
starts up. How you do that depends on the Unix flavour - often the
script is installed in /etc/init.d/bigbrother, and then you need to
create links from /etc/rc2.d/S99bigbrother -> /etc/init.d/bigbrother

Since there also were stop in the script you should also link the script to /etc/rc1.d/K01bigbrother to automatically stop bigbrother

Ie. ln -s /etc/init.d/bigbrother /etc/rc1.d/K01bigbrother
quoted from Lars Ebeling

Regards

Lars

 
Hobbithobbyist

"If you run UNIX and you don't have a UPS, you should see a psychiatrist...."
--Byte Magazine (years ago)
list Kevin Hanrahan · Mon, 25 Apr 2005 00:04:56 -0400 ·
Gentlemen,
  Thank you all for your responses and input for the auto restart
problem I was having. I will try all the suggestions posted here. I have
gotten better, faster, more intelligent, and more accurate, well thought
out responses here than I have EVER received from any "commercial"
product and I appreciate it. Henrik has done an astounding job of
producing a product that is extremely useful and actually works (as
opposed to the usual commercial product "we'll fix it in the next
release" but it still costs 300 thousand dollars!) but the support
afforded by this message board exceeds any tech support I have ever seen
and I thank you all for it!
 
Sincerely
 
Kevin