9 Replies Latest reply: Jan 12, 2012 7:40 AM by JWERLEIN RSS

How best to schedule an alert to reset service at 5:30 each day?

gbutler
Currently Being Moderated

I have a request for NPM to reset a service at 5:30 AM each day.  I had a hard time grasping this one in that an alert is suppose to react to something going wrong.... not act because its a set time of day... oh well.

I figure this is doable but I"m having problems. When I set my special alert, the alert will trigger but the actions do not go off.

The trigger is set to go off when the component statis is NOT Down.... the Time of Day will be 5:30 AM - 5:40 AM.  Here is what I have (with a test time set... ).  The alert shows a trigger but no event occurs.

Anyone have ideas?

  • Re: How best to schedule an alert to reset service at 5:30 each day?
    morgolis
    Currently Being Moderated

    I'm not entirely certain why you don't write a script on the local server and then use windows task scheduler to call the script to restart the service. 

    What are the actions you associated with this alert?

    • Re: How best to schedule an alert to reset service at 5:30 each day?
      Andy Ng
      Currently Being Moderated

      I second what morgolis is saying.

      And it is not practical to set up an Advanced Alert just to restart a service.

      Either you get it to restart at 5:30 AM regardless of the state that the service is on using Windows Task Scheduler.

      To have a more professional touch, you can create a script (maybe using Perl) to check the state of the service and make the script run at 5:30 AM using Windows Task Manager if a certain criteria is met.

      The call is yours.

      HTH.

      • Re: How best to schedule an alert to reset service at 5:30 each day?
        gbutler
        Currently Being Moderated

        My first reaction was similiar to yours... this is a job for cron... not $$ monitoring system... but I'm in the world of microsoft and having the ability to manage a centralized restart is what is really being asked.

        They have a specific problem in which the said service has a memory leak and will eventually die.  It was solarwinds that has been set up to restart the service when it would fail and it was solarwinds that clearly shows the memory leak.

        My first reaction was to "fix" the problem but the reality is the service is old unsupported code that is important enough to keep but not to fix.  Which from my experience is not an uncommon issue... we would not need solarwinds to restart stuff if stuff wasn't buggy.

        The overhead of starting a service once a day is small... I'm not adding any additional monitor... and to be frank my company is spending a lot of $$ and I don't think the request is unreasonable.  Today, solarwinds will restart the service whenever the service dies which depending on memory... can occur at any time... if we restart daily at 5:30... we have a service is more predictably up.

        The alternative is to have someone create code at each server location is not going to fly well with the folks that I service (BTW who pays the bills).

        • Re: How best to schedule an alert to reset service at 5:30 each day?
          mdavis911
          Currently Being Moderated

          Hmmm.. well if the alert is triggering and resetting immediately then maybe you could run your tasks as reset actions instead of trigger actions?  Maybe the trigger is resetting too quickly to process the trigger action but the reset action will get it?

          Also - if it work as a reset action but not as a trigger action you can figure the alert logic was tripping it up.  If it still does not work then maybe there is a problem with the action you are attempting to perform.

          • Re: How best to schedule an alert to reset service at 5:30 each day?
            gbutler
            Currently Being Moderated

            I adjusted the resset and the alert log shows the alert triggering and the reset taking place but no actions.  I gave it 5 minutes of a delay.

            The other idea I have is to create a monitor that will trip if the time is between a given interval.  Say if time is between 5:30 and 5:40 send the trip message. That way the alert can do what it's suppose to do... react to a monitor tripping. I was hoping I would not need to do that. 

            If its a vbscript with a TIME period as an argument I could handle other request that come about for regularly starting a job.

            I can just imagine SW folks grinding their teeth... this is a monitoring tool... not a scheduler!! ;-) 

    • Re: How best to schedule an alert to reset service at 5:30 each day?
      gbutler
      Currently Being Moderated

      Two actions... one is write to event log, the other is starting and stopping the service... I was unable to use the APMservicecontrol because the methods to start/stop were complicated and also needed to be able to authenticate to servers not in the orion servers active directory domain.

      Neither action fires.

      • Re: How best to schedule an alert to reset service at 5:30 each day?
        mdavis911
        Currently Being Moderated

        My best guess as to why that would not work is that your reset condition matches your trigger condition.

        The trigger is if Component Status is not equal to Down (so if your monitor is up in most cases I assume) and then you reset right after since the status is Up. 

        I would tend to agree with the other two replies that a script on a task schedule would best suit a service restart.  What are you attempting to log to a Windows Event log?  Maybe you could stop the service with a script, trigger an alert that the service is down, write info to event log and start the service again?

  • Re: How best to schedule an alert to reset service at 5:30 each day?
    gbutler
    Currently Being Moderated

    My end result was creating a vbscript monitor that given a time argument would flip for a set period of time.  The alert triggers like a normal alert with actions occurring.

    I suspect down the road there is a chance that I will have more requests to start this app on selected servers at a given time.

    Thanks for thoughts and ideas... it helps!

     

    Glenn.

  • Re: How best to schedule an alert to reset service at 5:30 each day?
    JWERLEIN
    Currently Being Moderated

    I had the same exact need.. I got this to work using the native orion Alert tools without scripting..

    1. set the alert to run sun-sat  and between (in my case 4:45Am and 4:50Am) only

    2. because the normaly issue is the alert will always be set because it is in a happy status.. it will run once and not reset.. soooo

    --set the 'trigger condition/ Alert escalation ' to repeat every 5 min.. In this case each time the alert is scheduled to run. (4:45 it will repeat the requested action within the aloted time frame..

     

    *** NOT the exact 4:45 need but does get it within 5 min.. 

    it is working for me.. (saves programmers from having to get up and restarat a service every morning) or (( redoing the code to fix the issue.. ))

More Like This

  • Retrieving data ...