Ad Widget

Collapse

FEATURE REQUEST: Add File Modtime check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #1

    FEATURE REQUEST: Add File Modtime check

    Greetings,

    One of the most common checks SysAdmins do on Unix systems is checking modtime for various files. They will then do various things based on this information.

    What I would like to request is adding this functionality to the agent as well. The check would then return the date, in seconds, when the file was last modified. If used correctly, this would allow various other system health checks to be brought under Zabbix monitoring.
    Unofficial Zabbix Developer
  • tommie
    Junior Member
    • Aug 2005
    • 7

    #2
    stat

    Hi!

    You should be able to do that with a UserParameter using

    Code:
    /bin/stat --format '%Y' file
    /bin/stat is included in GNU coreutils. Of course, forking programs takes resources - but is easy.

    /Tommie

    Comment

    • James Wells
      Senior Member
      • Jun 2005
      • 664

      #3
      Yup, is how I currently do it, but as you say it has to fork a process to do it, and, even more importantly for me, it has to be pushed out in the zabbix_agentd config file.
      Unofficial Zabbix Developer

      Comment

      • tommie
        Junior Member
        • Aug 2005
        • 7

        #4
        Just a thought...

        Would it be enough to store the configuration in a central location and to download it to the agent and restart that once a day? Possibly running a preprocessor on it to use the file on various hosts.

        Just curious; in what way is the config-file troublesome?

        /Tommie

        Comment

        • James Wells
          Senior Member
          • Jun 2005
          • 664

          #5
          Originally posted by tommie
          Just a thought...

          Would it be enough to store the configuration in a central location and to download it to the agent and restart that once a day? Possibly running a preprocessor on it to use the file on various hosts.
          That would work quite well for me.

          Just curious; in what way is the config-file troublesome?
          The config file isn't really that troublesome, it is simply an issue of economy of scale. At present, the confiuration file has to be different for each and every system, specifically the hostname entry.

          For my network, due to the way my network was built, before I started working here, each configuration file has to have two other custom values set for each system. And while I manage the current configs with a pre-processor, it still adds yet one more area for mischief. And with the number and variety of systems I currently manage... It can get a bit painful if one of them should the wrong way.
          Unofficial Zabbix Developer

          Comment

          Working...