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. Schedule starting at a specific date/time

Schedule starting at a specific date/time

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

    Hi,

    I'm trying to set a website monitoring where the content changes at a specific date/time.
    Otherwise said, I need to stop monitoring the current content at some moment and the start monitoring other content from that moment forwards.

    What would be the most efficient way to achieve this?

    I was thinking of creating two DCI's and set them when they should start/stop monitoring, can the cron syntax of the custom Schedule property of a DCI handle this?
    Otherwise scripting will surly get things done, but is it really needed?

    Regards,

    Dan

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

      Hi!

      What is exact purpose of monitoring this web site? If you need to detect content changes on any time except allowed, you can just use "diff" threshold, and in event processing policy skip event generated by threshold if it occurs within valid content change time interval.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • D
        D
        DanG
        wrote on last edited by
        #3

        Hi Victor,

        The content of this website changes at a specific date, I want the monitoring system to verify that the new content shows at that time.
        If the test runs before the due date it will fail, so I need a way to start monitoring at a specific date/time.

        Regards,

        Dan

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

          Hi!

          If you are not interested in checking that new content matches some exact text, but just to check for fact of change, then my proposed solution with diff thresholds will work. However, if you have to check that new content is available and matching some specific text/regexp, you have to create new DCI for each upcoming content change, and use advanced scheduling to execute it at specific time. With advanced scheduling, you will be able to execute the check at exact time or in given short interval. You can also use Java or C API to automate DCI creation if you have some external application which knows what the content will be.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • D
            D
            DanG
            wrote on last edited by
            #5

            Hi Victor,
            I’m afraid it doesn’t solve my problem. Having a one shot to test the website is not good enough, I need to test that page every minute starting on a specific date. To my best knowledge cron does not offer this functionality.

            I ended up adding a DCI Transformation Script to filter the event for a given date range:

            sub main()
            {
             if(
                    localtime(time())->year == 2012
                   
                && localtime(time())->mon >= 0
                && localtime(time())->mday >= 1
               
                && localtime(time())->mon <= 0
                && localtime(time())->mday =< 15
              )
              {
              return $1;
              }

              return 0;
            }

            In this example for all tests within 1st and 15th of January 2012 the real result is returned ($1).
            For anything outside that period, success (=0) is always returned disregarding the actual result.
            Alternatively I could have added something similar to the Filtering Script of the Event Processing Policy, however that would require me to create a new Event and Processing Policy for each date rage I want to test on. Using the Transformation Script  for Filtering may be misusing it, but it does the job. I guess that adding a Filtering Script feature before the Transformation Script is an overkill.

            Regards,

            Dan

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

              Hi!

              Yes, the main problem with advanced schedule is that you cannot specify year in schedule. Otherwise within a year you can create very flexible schedules - don't forget that you can specify more than one schedule for DCI. For example, monitoring from 15.01 9:00 till 10.03 14:59 can be defined as follows:

              * 9-23 15 1 *
              * * 16-31 1 *
              * * * 2 *
              * * 1-9 3 *
              * 0-14 10 3 *

              1 - covers period 15.01 9:00 - 23:59
              2 - covers period 16.01 00:00 - 31.01 23:59
              3 - covers entire February
              4 - covers period 01.03 00:00 - 09.03 23:59
              5 - covers period 10.03 00:00 - 10.03 14:59

              And I don't think that using transformation script here is a misuse - it is what they was intended for.

              Best regards,
              Victor

              1 Reply Last reply
              0
              • D
                D
                DanG
                wrote on last edited by
                #7

                Hi Victor,

                Thanks for the example. Although it surly works I find it to be too error-prone, at least for me it is 🙂
                I'm glad I'm not misusing anything, so I'll stick to my script 😉

                Regards,

                Dan

                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