Ad Widget

Collapse

zabbix sender question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alex_SYB
    Senior Member
    • Feb 2012
    • 133

    #1

    zabbix sender question

    Hi

    I would like to monitor certain files with chksums... but I can use the agent, because the agent doesn't have access to the files ... for example

    /etc/shadow

    so i was thinking i could write a script to run as root to grab all the stuff I need run it once a day (or some schedule) and then use zabbix_send to send it back to the server.

    but what how do I create an item .. what schedule do I put what type of item ???

    Thanks
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    See: Trapper items

    Comment

    • Alex_SYB
      Senior Member
      • Feb 2012
      • 133

      #3
      Originally posted by BDiE8VNy
      Thanks

      I thought this was for snmp...

      Comment

      • Alex_SYB
        Senior Member
        • Feb 2012
        • 133

        #4
        Hi

        Wondering if I can get some help with the sender program. So my thought is I want to do md5sum on certain files that the agent can't get to because of permissions and i don't want to open them up for the user that the agent runs under.

        So my thought is to run a program via cron that basically does a md5sum of certain files and then sends it back to the server. I was hoping to build a file and send it in one go not separate sends !

        md5sum <list of file> | awk ' {print $2 $1}'

        that gets me to the format as described in the man page
        http://www.zabbix.com/documentation/.../zabbix_sender

        but for -T it talkes about unix timestamp is that number of sec since epoc ?
        so something like
        date "+%s"

        next in the example given the - as the first column says to grab the hostname from the cmdline

        and its white space delimited, if I want spaces in there, do I need to add "" around the values ?


        so I could do something like this (bash)

        DT=$(date "+%s")

        md5sum /etc/passwd /etc/shadow /etc/group /etc/samba/smb.conf | awk -F\ " {print \"- md5sum[\"\$2\"] $DT \"\$1 }" | zabbix_sender -c /usr/local/etc/zabbix_agentd.conf -T -i -


        A


        EDIT:

        My alternative is to create userparam and use sudo md5sum and then allow NOPASSWD sudo access for zabbix_agent userid to md5sum ...

        later seems easier

        So what have others done in this situation ?
        Last edited by Alex_SYB; 13-12-2012, 03:08.

        Comment

        • BDiE8VNy
          Senior Member
          • Apr 2010
          • 680

          #5
          Originally posted by Alex_SYB
          [...]I want to do md5sum on certain files that the agent can't get to because of permissions and i don't want to open them up for the user that the agent runs under.
          Check out Proposal: Privilege separation for ZABBIX agent(ZBXNEXT-195) and vote for it ;-)
          Originally posted by Alex_SYB
          [...] -T it talkes about unix timestamp is that number of sec since epoc ?
          so something like
          date "+%s"
          exactly!
          Originally posted by Alex_SYB
          and its white space delimited, if I want spaces in there, do I need to add "" around the values ?
          No idea, never tried to do so. What use case force spaces within host names?

          RFC952: A "name" (Net, Host, Gateway, or Domain name) is a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-), and period (.). [...] No blank or space characters are permitted as part of a name.

          RFC1123: [...] the restriction on the first character is relaxed to allow either a letter or a digit.
          Originally posted by Alex_SYB
          My alternative is to create userparam and use sudo md5sum and then allow NOPASSWD sudo access for zabbix_agent userid to md5sum ...
          I've read your post last night and that is exactly what I wanted to suggest today :-)

          Comment

          • Alex_SYB
            Senior Member
            • Feb 2012
            • 133

            #6
            Hi

            I wasn't actually thing of hostname, more the other values, like keys and actual values.


            thanks

            Comment

            Working...