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. unsigned int64 bit data polling

unsigned int64 bit data polling

Scheduled Pinned Locked Moved Support
8 Posts 2 Posters 16.3k 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
    duanebutler
    wrote on last edited by
    #1

    Good day

    I am busy setting up File.Time.Access / Change / Modify parameters. 

    I don not understand the Int64 bit type.  Is the data in milliseconds? When i convert it, the data set is wrong in days or hours.

    My server's date is correct tho as i thought it could be NTP or system date.

    Thanx

    1 Reply Last reply
    0
    • D
      D
      duanebutler
      wrote on last edited by
      #2

      I found that it polls UNIX time.

      How can i convert this once polled?

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

        Hi,

        depending on what you want to achieve. If you are interested in file's age, you can get it in seconds using transformation script like this:

        return time() - $1;
        

        For more complicated transformations you can use gmtime or localtime functions. Both returns break down time as TIME object. There is also function strftime that can be used to format time but it is not documented yet.

        Best regards,
        Victor

        1 Reply Last reply
        0
        • D
          D
          duanebutler
          wrote on last edited by
          #4

          Thanx Victor

          Much Appreciate it.

          By files age do you mean the date stamp on file when last modified?

          I will try the script and see how it goes.

          Thanx alot!!

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

            Hi,

            by file age I meant how old it is - difference between current time and time of file creation/modification.

            Best regards,
            Victor

            1 Reply Last reply
            0
            • D
              D
              duanebutler
              wrote on last edited by
              #6

              Hi Victor

              I am fairly new to NetXMS scripting.  I actually got this far as to use the gmtime function gmtime()->mday to get the day only.

              How can i use the gmtime function to extract the DD-MM-YYYY and maybe HH-SS if possible? Like 12-01-2016 14:30

              Regards

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

                If you need to format date like this you can use strftime function:

                return strftime("%d-%m-%Y %H:%M", $1);

                This will convert UNIX time stamp from $1 into string of format DD-MM-YYYY HH:MM.

                Alternatively, you can use string concatenation, like this:

                t = gmtime($1);
                return t->mday . "-" . t->mon . "-" . t->year;

                Best regards,
                Victor

                1 Reply Last reply
                0
                • D
                  D
                  duanebutler
                  wrote on last edited by
                  #8

                  Hi Victor

                  Thanx so much for your help.  It put me in the right direction.

                  My script i compiled was:
                  t = ($1);
                  day = gmtime(t)->mday;
                  mon = gmtime(t)->mon+1;
                  year = gmtime(t)->year;
                  hour = gmtime(t)->hour;
                  min = gmtime(t)->min;
                  return day."-".mon."-".year."/".hour.":".min;

                  This gave me an output in the following date format:
                  14-1-2016/14:29
                  DD-M-YYY/HH:MM

                  I also struggled a bit but remembered to capture string data and not int.

                  I find this helpful for monitoring last modified date and time (which is highly important in my company for some files).

                  Just wanted to say thanx to Victor.  Really appreciate your help.

                  Regards
                  Duane

                  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