Installing zabbix-agent on pfsense 2.0.2


  • once logged in to shell on pfsense, i ran below commad succesfully (after enabled WAN interface)

    pkg_add -r http://ftp.nl.freebsd.org/pub/FreeBSD/ports/packages/All/zabbix-agent-1.8.13,2.tbz

    but I could not find rc.local.conf to enable autostart of zabbix-agentd

    cd /usr/local/sbin/
    ./zabbix-agentd start
    ./zabbix-agentd status

    does not give any output

    i'm able to telnet to port 10050 on pfsense though

  • Netgate Administrator

    A number of things occur to me.

    pfSense 2.0.2 is built on FreeBSD 8.1, that ftp site appears to be for a far more recent release.
    You probably wanted to use:

    http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/8.1-RELEASE/packages/All/zabbix-agent-1.8.2_2%2c2.tbz
    

    @malayo:

    does not give any output

    No output at all would be very surprising. I assume it actually gave some error, what was it?

    Steve


  • after reboot and reconfigure config file to point to correct IP of zabbix server, i managed to telnet port 10050 but it quickly got disconnected as below

    # telnet 192.168.56.120 10050
    Trying 192.168.56.120...
    Connected to 192.168.56.120.
    Escape character is '^]'.
    Connection closed by foreign host.
    

    i added pfsense host with pfsense template but I can see is snmp shown in red "timeout connecting to [192.168.56.120:161]"

    running below from zabbix server gave output 0.000000

    zabbix_get -s 192.168.56.120 -p 10050 -k "system.cpu.load[all,avg1]"
    

    from my laptop (192.168.56.1)

    # snmpwalk -c Str1nG -v 2c 192.168.56.120 | head
    iso.3.6.1.2.1.1.1.0 = STRING: "pfSense.localdomain 4030001430 FreeBSD 8.1-RELEASE-p13"
    iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.12325.1.1.2.1.1
    iso.3.6.1.2.1.1.3.0 = Timeticks: (372873) 1:02:08.73
    iso.3.6.1.2.1.1.4.0 = ""
    iso.3.6.1.2.1.1.5.0 = STRING: "pfSense.localdomain"
    iso.3.6.1.2.1.1.6.0 = ""
    iso.3.6.1.2.1.1.7.0 = INTEGER: 76
    iso.3.6.1.2.1.1.8.0 = Timeticks: (3) 0:00:00.03
    iso.3.6.1.2.1.1.9.1.2.1 = OID: iso.3.6.1.4.1.12325.1.1.1.10.2
    iso.3.6.1.2.1.1.9.1.2.2 = OID: iso.3.6.1.4.1.12325.1.1.1.10.3
    

  • finally got server to show green on zabbix agent & snmp on status. Below are my configs

    pfsense zabbix_agentd.conf
    –--------------------------
    LogFile=/tmp/zabbix_agentd.log
    Server=192.168.56.101
    Hostname=router

    zabbix server

    Server=localhost,zabbix
    Hostname=Zabbix Server
    StartAgents=5
    DebugLevel=3
    PidFile=/var/run/zabbix-agent/zabbix_agentd.pid
    LogFile=/var/log/zabbix-agent/zabbix_agentd.log
    Timeout=3

    note:

    -i'm connecting trough IP, hence Hostname are based on host setting at zabbix interface
    -i add entry on /etc/hosts for zabbix hostname of zabbix server
    -templates used on pfsense host Template_SNMPv2_Device & Template_pfSense