Ad Widget

Collapse

ZABBIX Agent for Freetz (FRITZ!Box)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #1

    ZABBIX Agent for Freetz (FRITZ!Box)

    Hi

    with the files in the attached tarball you can add zabbix_agentd to your subversion working copy of Freetz.
    If you follow the instructions of the included INSTALL file, you will add zabbix_agentd version 1.4 as well as a Web-GUI for configuration to your Freetz image.

    The agent has been tested with the developement version of Freetz on an AVM FRITZ!Box Fon WLAN 7270 and a ZABBIX Server version 1.8.4

    Update: There is also a release based on ZABBIX 1.8.15. See more on Freetz - Ticket 1883
    Attached Files
    Last edited by BDiE8VNy; 01-09-2012, 21:52. Reason: Add information about release based on 1.8.15
  • frater
    Senior Member
    • Oct 2010
    • 340

    #2
    I'm in the process of implementing Zabbix on Freetz.
    It's working already and I already created some new user defined functions that may come in handy.

    Here are some of the functions I already wrote. I will be posting more in the future. First I need to sort some things out...

    cat ./make/zabbix_agentd/files/root/etc/default.zabbix_agentd/zbx_agentd_user_parameters.examples
    Code:
    ####### USER-DEFINED MONITORED PARAMETERS #######
    # Format: UserParameter=<key>,<shell command>
    # Note that shell command must not return empty string or EOL only
    UserParameter=net.ping[*], ping -c1 -W1 $1 2>/dev/null | grep -c 'bytes f'
    UserParameter=dsl.upstream, grep -o 'US Connection Rate:.*' /proc/avalanche/avsar_modem_stats | awk '{print $4}' | tr -cd '0-9'
    UserParameter=dsl.downstream, grep -o 'DS Connection Rate:.*' /proc/avalanche/avsar_modem_stats | awk '{print $4}' | tr -cd '0-9'
    UserParameter=dsl.upsnr, grep -o 'US Margin:.*' /proc/avalanche/avsar_modem_stats | awk '{print $3*10}'
    UserParameter=dsl.downsnr, grep -o 'DS Margin:.*' /proc/avalanche/avsar_modem_stats | awk '{print $3*10}'
    UserParameter=dsl.upcrc, grep -A1 '(TX) Interleave path' /proc/avalanche/avsar_modem_stats | grep CRC: | awk '{print $2}'
    UserParameter=dsl.downcrc, grep -A1 '(RX) Interleave path' /proc/avalanche/avsar_modem_stats | grep CRC: | awk '{print $2}'
    UserParameter=dsl.los, grep -o 'LOS errors:.*' /proc/avalanche/avsar_modem_stats | awk '{print $3}' | tr -cd '0-9'

    Here are some problems I still need to solve:
    • I can't seem to edit the file /var/tmp/flash/zbx_agentd_user_parameters from the webif.. (maybe needs a reboot?)
    • ping needs root privileges, how to solve?
    • On DD-WRT I have zabbix 1.6. Higher versions seem to give some problems. Why is this one 1.4? (current stable is 1.8.7)


    I have some ideas to resolve the "privilege problem".
    • I can use sudo, but the package sudo is not included.
    • Use the setuid bit for ping, but haven't tested it. Because ping is inside busybox I need to either setuid "busybox" or...
    • ...install the package "ping" and setuid that one. 'ping' is also not included as a seperate package (nor is inetutils)
    • Run zabbix as root (haven't tested that one either)


    The only thing I can do at this moment is change the attribute of busybox, but it is also the least elegant one. Everything busybox does will be done with root privileges.
    Because I have just recently started with Freetz I don't know yet how to install new packages that are not available (using 'make menuconfig').

    Maybe the OP can help me out...
    Last edited by frater; 08-09-2011, 23:38.
    Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

    Comment

    • frater
      Senior Member
      • Oct 2010
      • 340

      #3
      Thanks to sf3978 on this forum: http://www.ip-phone-forum.de/showthread.php?t=231507

      I was able to get 'sudo' compiled and implemented.
      I now have an agent ping, which is not possible with the standard agent.

      I will be writing much more in the near future and when I have a nice and balanced Freetz-template and Freetz firmware I will publish it here...

      I now have graphs for DSL-bitrate and will create triggers when CRC-errors occur and bitrate changes....
      Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

      Comment

      • BDiE8VNy
        Senior Member
        • Apr 2010
        • 680

        #4
        Updated to version 1.8.15

        Comment

        Working...