Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Restart a service if alarm is triggered (service is not down)

Restart a service if alarm is triggered (service is not down)

Scheduled Pinned Locked Moved Support
4 Posts 3 Posters 16.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    S
    stoffmann
    wrote on last edited by
    #1

    Hello,

    I'm monitoring a webservice using NetXMS and want to restart the windows service that's responsible for this webservice, in case of a returnvalue other then HTTP 200.
    The monitoring already works fine and I get notified when the returnvalue is different to 200.
    The service itself is running when I check it, but it delivers no results anymore.
    So I restart in manually at the moment to fix this.

    How can I make NetXMS do the net stop/net start commands?

    Best regards

    Stefan

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi,

      you can define action in agent configuration file on that machine:

      ActionShellExec = RestartService:net stop svcname && net start svcname
      

      (I'm not sure if command is actually correct, but you should get an idea).

      then define server side action of type "execute command on remote node", enter RestartService as command name, and add this new action in EPP to be executed on web service error event.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • R
        R
        rainerh
        wrote on last edited by
        #3

        Hello,
        i want to watch a service called FileWaveWinClient.
        The Alarm works fine, but the Server action does not work.

        In agent´s config file I added this line:
        ActionShellExec = StartFileWaveService:"C:\Windows\system32\net.exe" start FileWaveWinClient

        I tried also:
        ActionShellExec = StartFileWaveService:net start FileWaveWinClient

        In Actions Configuration I added
        Name: Start_FileWaveWinClient_Service
        Type: Execute command on remote node via agent
        Remote host <empty>
        Agents´s action: StartFileWaveService
        (See attachment "Action Configuration.png")

        I create a Event Processing Policy
        Events: ... Process not running
        Alarm - this configuration works fine. The Alarm is working
        Server Actions: Start_FileWaveWinClient_Service - does not work
        (See attachment "Event Processing Policy.png")

        The Alarm works fine, but the Server action does not work.

        Thank you
        Rainer


        Action Configuration.png

        Event Processing Policy.png

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          You should put either %a (to use IP address) or #%i (to refer to current node by ID) in "remote host" field.

          Best regards,
          Victor

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups