Operating System - HP-UX
1838407 Members
3337 Online
110125 Solutions
New Discussion

MC/ServiceGuard package monitor (service) script

 
John Hall
Frequent Advisor

MC/ServiceGuard package monitor (service) script

Occassionally maintenance needs to be done on our MC/ServiceGuard (MCSG) service script that monitors the only configured package. To do this, the script must be stopped but in doing so MCSG would complain (and possibly failover). To prevent failover, I decided to have the monitor script, the one that MCSG starts (I'll call it "xyz1"), execute another script that actually does the monitoring (I'll call this extra script "xyz2"). Then when I turn "maintenance mode" on (by touching a file called /tmp/MCSG_maint), the "xyz1" script does not execute "xyz2". I then perform maintenance on "xyz2" and when I'm done I remove /tmp/MCSG_maint at which time "xyz1" resumes executing "xyz2".

I asked the instructor in my MCSG II Training Class if this was a sound idea and was told, "Yes".

Here's my question: Does this execution of "xyz2" cause any significant load on the system? And is this indeed a good idea (or at least not a bad one)?
9 REPLIES 9
Mark Grant
Honored Contributor

Re: MC/ServiceGuard package monitor (service) script

Personally I can't see that there is any load you are going to notice here and it seems a reasonable idea to me.
Never preceed any demonstration with anything more predictive than "watch this"
Kent Ostby
Honored Contributor

Re: MC/ServiceGuard package monitor (service) script

John -- In general, its not a bad idea as long as you are not spawning A LOT of copies of xyz2.

The questions that you have to ask yourself about this sort of thing is:

#1) How will this new script communicate to xyz2 that the process being monitored has failed (my guess would be -- have it kill xyz1 :-) ) Then the "official" monitor script would be dead.

#2) What happens to your production if you happen to die during your maintanence window ? Or more to the point.. keep in mind that this scheme means you will be manually monitoring your processes during the maintanence period.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Marco Santerre
Honored Contributor

Re: MC/ServiceGuard package monitor (service) script

I don't think it would cause any more load on your system.
Cooperation is doing with a smile what you have to do anyhow.
Ashwani Kashyap
Honored Contributor

Re: MC/ServiceGuard package monitor (service) script

We do something similar here at our shop too . And I havent noticed any additional load on the system .
Jean-Louis Phelix
Honored Contributor

Re: MC/ServiceGuard package monitor (service) script

Hi,

I wouldn't care about the overhead. But I don't clearly see the advantage of having another script. You could simply do something like :

while :
do
if [ -f /tmp/MCSG_maint ]
then
echo maintenance mode
else
test_monitored || exit 1
fi
sleep 60
done

exit 0
It works for me (© Bill McNAMARA ...)
Gavin Clarke
Trusted Contributor

Re: MC/ServiceGuard package monitor (service) script

Yes we do that here too, it runs every five seconds and creates no appreciable load. It mainly looks for processes.

melvyn burnard
Honored Contributor

Re: MC/ServiceGuard package monitor (service) script

There should be almost no system overhead on this, provided it is not doing something "silly".
This exact idea and methodology should be discussed in the Advanced MC/ServiceGuard 3 day course, also known as hte Serviceguard II course, which you went on.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
John Palmer
Honored Contributor

Re: MC/ServiceGuard package monitor (service) script

It sounds a reasonable idea but how do you do maintenance on xyz1?

I only have the equivalent of xyz1 but this is coded to 'exec itself' on receipt of a particular signal.

exec is useful for this because no new process is spawned.

Regards,
John
John Hall
Frequent Advisor

Re: MC/ServiceGuard package monitor (service) script

There were many responses and I will attempt to answer them all here.

The script that MCSG starts is "xyz1" and that script does not change and it is ALWAYS running and it is never killed. Then every 10 seconds "xyz1" runs "xyz2" but only if maintenance mode is OFF (the maintenance file does not exist). If maintenance mode is on (the maintenance file exists) then "xyz2" is not executed which gives me time to make modifications to "xyz2" WITHOUT taking the package down -- this is the whole idea of this 2 script setup. There is only one instance of "xyz2" running at a time.

Thanks to everyone for the help.