Ad Widget

Collapse

Custom Macro & File exist check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • green.naezl
    Junior Member
    • May 2010
    • 3

    #1

    Custom Macro & File exist check

    Good morning everybody

    I have to monitor a workflow, which includes Sheduled Tasks (Windows).

    Those sheduled tasks execute various batch scripts. Those batch scripts create
    from a input file, a convertet output file.

    Problem:
    I need to check if the output file was generated. Those output files have a specific format: 05_LOG_YYYYMMDD_WEB_00.txt

    How can I check those files, when the date is in format YYYYMMDD, the Zabbix Macro {DATE} uses dots between years, months and dates.

    Can I create a custom date format macro?


    Thanks for your help!
    Have a nice day

    Greets
    Stephan

    PS: Is there a way to check if a sheduled task was executed?
  • m4rv1n
    Junior Member
    • Feb 2011
    • 14

    #2
    hello,
    have you solved?
    i have your problem

    to see if scheduled task was executed you have to filter state, 0x0 is ok.
    please pm me if you have solved wit hmacro for date.
    thanks

    Comment

    • green.naezl
      Junior Member
      • May 2010
      • 3

      #3
      hi,

      it's a long time ago, but finally I had written down the whole workflow in a VB-Script with different exit-states.

      for example -> exit-codes:
      0 - everything fine
      1 - file wasn't created

      etc..

      I'm sorry, but I'm no longer working on this project, so I cant give you my scripts.... but a good structured reusable script will help you nearly everywhere in zabbix if you have to deal with timestamps and files :P

      Greets
      Stephan

      Comment

      • m4rv1n
        Junior Member
        • Feb 2011
        • 14

        #4
        ok, under linux is not a problem but is a mistake for me introduce it in a item to check (i check from zabbix and not from other host and would to do a macro, not a script)
        also you remember how to run a comman by agent and if can the agent exec a script with a user scripted?
        example, agent running with user A but in the script run the command with user B.
        thank you!
        Last edited by m4rv1n; 13-02-2011, 19:16.

        Comment

        • green.naezl
          Junior Member
          • May 2010
          • 3

          #5
          to change the execution rights you probably use sudo?!

          but don't ask me how. sudo is a bad thing in the false hands (respectivly in false use)....

          the problem, currently I have no other solution to the time-stamp problems in zabbix....

          what you could try is execute a script on your zabbix machine, which will remotly check the target. But in case you use active/passive checks this might throw other problems.....


          greets
          Stephan

          Comment

          • m4rv1n
            Junior Member
            • Feb 2011
            • 14

            #6
            sudo change execution rights only on the zabbix server but not on the agent (linux/windows), the agent take ever the user of the service

            the problem of time, i try something but hope zabbix make more flexible the product with more simple things.

            i can try a script and with this i'm sure to go (i check smb and other with script), but i would to make some thing with macro cause with external script the execution of zabbix go slow.

            hope to find!

            thanks
            regards

            Comment

            Working...