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. Using best notification action

Using best notification action

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 27.4k 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.
  • G
    G
    Goriem
    wrote on last edited by
    #1

    Hi

    my question is this:
    can i scipt an action that chooses between sendiing sms or execute command depending on status of a situation?

    i have an action for sending sms and an action that sends an online notification to my notifo account via curl

    i also have a situation evaluation if there is internet access called internetaccess - i have used this to evaluate if a ping to an external host should generate an alarm based upon avaliability of my router and firewall.

    i would like my action to notify me via the execute command action when there is internet access but then to default to sending sms when no internet is accessible.

    is this possible and if it is - how do i do this in the smartest way?

    regards

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

      Hi!

      Yes, this is possible. You have to create two rules: one for sending SMS and second for executing your notification script. In first rule you have to add filtering script, which will return TRUE if there are no internet connection. For second rule you can use the same script, but with reversed return values: FALSE if there are no internet connection and TRUE if internet connection is available. Depending on your policy, you may also add "stop processing" flag to first rule (for SMS sending), and do not use filtering script in second rule at all.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • G
        G
        Goriem
        wrote on last edited by
        #3

        Hi
        thanks for your reply i had hoped to accomplish this a "smarter" way, by getting my alert action to evaluate upon status of my internetaccess so that i did not need two events for every alert but this aproach will work, you're quite right.

        thankyou

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

          You don't need two events, just two different rules for same event.

          Also, if you want to put this logic into your script, it is also possible. You can just pass additional parameter to your script, giving current status of internet connection. In action definition, you can use macro %[script_name], and in the script return different values depending on internet connection state.

          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