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. Email alert time specific

Email alert time specific

Scheduled Pinned Locked Moved Support
2 Posts 1 Posters 11.6k 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.
  • M
    M
    mjk
    wrote on last edited by
    #1

    Hi guys

    I am struggling to get 24/7 and 0800-1800 m-f alerts on different devices.
    Currently i have them container based, so i can just say "anything in 24/7 container just alert" and stop event processing

    The problem comes with the weekday alerts
    i have tried to find details in the forums and found weekdays and the times, my issue is how do i add BOTH of these!

    my example i have mushed together is -

    sub main()
    {
    now = localtime();
    return (now->hour >= 8) && (now->hour < 18);
    t = localtime();
    return (t->wday >= 1) && (t->wday <= 5);
    
    }
    

    Basically this will only send an alert for issues between 0800- 1800 Monday to Friday..
    My next problem will be to create alarms if they are still down come 0800!
    I have also created an event which will raise and alarm and not email, as i was finding the device offline but no alarm in the object..

    I really am struggling to validate if the rules work, i changed to sat/sun, to test and changed the time, but they both need to be true..

    Thanks

    1 Reply Last reply
    0
    • M
      M
      mjk
      wrote on last edited by
      #2

      I think i have it down with this filtering script on the alerts

      sub main()
      {
      now = localtime();
      return (now->hour >= 8) && (now->hour < 18) && (now->wday >= 1) && (now->wday <= 5);
      }
      

      If you use scheduled maintenance plans it will also do a similar thing, but i still wanted to note when it had gone down, and send those notes (or read them) when we got it.

      So i have a EPP that just sayd "notify when down - no alerts, and that adds a custom entry for the exact time it went down)
      I'll figure out how to run a task to alert on all down systems at 0800 that grabs that data from the custom field another time!
      For now, i just dont want our  9-5 customers being charged for 24/7 work!

      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