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. Time schedule for E-Mail notification

Time schedule for E-Mail notification

Scheduled Pinned Locked Moved Support
6 Posts 2 Posters 43.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.
  • L
    L
    Lostavar
    wrote on last edited by
    #1

    Hello,

    I have 2 questions regarding e-mail alerting:

    1. Is it possible to send alerts using a time-schedule?
      For example it want E-Mail notification Monday-Friday to person A, on Saturday and Sunday to person B.

    2. How can I add values from different DCIs to one alert?
      For example I have a threshold for percentage of disk usage. But in the alert message I want to see a) percentage used, b) absolutely used space (GB) and c) total amount of disk space.

    Thanks in advance!!

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

      Hi!

      @lostavar said in Time schedule for E-Mail notification:

      1. Is it possible to send alerts using a time-schedule?
        For example it want E-Mail notification Monday-Friday to person A, on Saturday and Sunday to person B.

      Yes, you can create two rules with different e-mail actions, and use filtering script in each rule to match Monday-Friday or Saturday-Sunday. Script to match Monday-Friday will look like following:

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

      Best regards,
      Victor

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

        @lostavar said in Time schedule for E-Mail notification:

        1. How can I add values from different DCIs to one alert?
          For example I have a threshold for percentage of disk usage. But in the alert message I want to see a) percentage used, b) absolutely used space (GB) and c) total amount of disk space.

        There are no easy way to achieve that - only via scripting. In message text, you can use %[..] macro, which will be substituted by value returned by given script. To use script in such macro, you should create it in script library (Control Panel -> Script Library).
        In the script, you can use FindDCIByName or FindDCIByDescription and GetDCIData functions to retrieve data of some other DCIs.

        For example, script wchich will return total amount of disk space on root partition will look like this (assuming thet you have configured appropriate DCI):

        GetDCIValue($node, FindDCIByName($node, "Disk.Total(/)"))
        

        Best regards,
        Victor

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

          @victor said in Time schedule for E-Mail notification:

          Hi!

          @lostavar said in Time schedule for E-Mail notification:

          1. Is it possible to send alerts using a time-schedule?
            For example it want E-Mail notification Monday-Friday to person A, on Saturday and Sunday to person B.

          Yes, you can create two rules with different e-mail actions, and use filtering script in each rule to match Monday-Friday or Saturday-Sunday. Script to match Monday-Friday will look like following:

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

          Best regards,
          Victor

          Just discovered that due to a bug attribute wday is not accessible. To fix it, replace file src/libnxsl/functions.cpp with attached one and recompile NetXMS server. If your server running on Windows, ask me and I'll post recompiled libnxsl.dll.

          Best regards,
          Victor


          functions.cpp

          1 Reply Last reply
          0
          • L
            L
            Lostavar
            wrote on last edited by
            #5

            Hello Victor,

            thanks for your quick response.
            Regarding question/answer 2: Yes, my server is running on Windows. Please post libnxsl.dll.

            Many thanks!!

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

              Updated libnxsl.dll.

              Best regards,
              Victor


              libnxsl.dll

              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