Ad Widget

Collapse

write trigger events in a text file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • whitehat
    Junior Member
    • Feb 2010
    • 25

    #1

    write trigger events in a text file?

    Is it possible to write trigger events to a text file? Some kind of event log?
    Now I see the only option is to create a daemon, that will periodically get events from the zabbix DB and then write them to a file, but, may be there is a simple way?
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    Tie an action to it which calls an external notification script that really just logs to file.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • whitehat
      Junior Member
      • Feb 2010
      • 25

      #3
      thanks

      Thank you, after uncommenting "EnableRemoteCommands=1" in /etc/zabbix/zabbix_agentd.conf and adding "zabbix ALL=NOPASSWD: ALL" in visudo i've managed to write a log file with a remote command: "Zabbix Server:sudo echo "{HOSTNAME}: {TRIGGER.NAME}: {STATUS}" >> /tmp/test.log"
      Last edited by whitehat; 26-02-2010, 09:50.

      Comment

      • nelsonab
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2006
        • 1233

        #4
        Using no passwd in the sudo file for Zabbix is a bad idea unless you limit it to a specific script. There is little in the way of authentication between the agent and server and thus it's possible for someone to take over your system through a sudo command via the zabbix agent.

        The idea I was thinking of was tie it to an alerting script similar to the sms and the authenticated smtp scripts. Under administration->media types you can select script and then add a link to your script there. Then you set your action to use this script. This is much safer from a security perspective.

        If the media type script does not work then please please please tie the sudo command to a specific script which can only be edited by the root user.
        RHCE, author of zbxapi
        Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
        Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

        Comment

        Working...