Ad Widget

Collapse

zabbix_agentd net.if.discover ZBX_NOTSUPPORTED FreeBSD8.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matram
    Junior Member
    • Jul 2012
    • 4

    #1

    zabbix_agentd net.if.discover ZBX_NOTSUPPORTED FreeBSD8.2

    I have set up Zabbix in a small system with 13 VM and 2 NAS. Everything is up and running but I am struggling with zabbix_agentd on FreeNas (based of FreeBSD 8.2 AMD64).

    On the server side I get no network discovery.

    On the client side i get this:
    [root@freenas] /mnt/home/zabbix/sbin# zabbix_agentd -t net.if.discover
    net.if.discover [m|ZBX_NOTSUPPORTED]

    and this:
    [root@freenas] /mnt/home/zabbix/sbin# zabbix_agentd -p
    agent.hostname [s|zabbix]
    agent.ping [u|1]
    agent.version [s|2.0.1]
    <-- snip -->
    system.uname [t|FreeBSD freenas 8.2-RELEASE-p9 FreeBSD 8.2-RELEASE-p9 #4: Thu Jun 14 10:08:45 PDT 2012 [email protected]:/build/home...ys/FREENAS.amd64 amd64]
    <-- snip -->
    vfs.fs.discovery [s|{
    "data":[
    {
    "{#FSNAME}":"\/",
    "{#FSTYPE}":"ufs"},
    <-- snip -->
    "{#FSNAME}":"\/etc\/local",
    "{#FSTYPE}":"unionfs"}]}]
    Segmentation fault

    Any advice?

    To compile the agent I have set up a separate FreeBSD v8.2 AMD64 VM compiled the 2.0.1 source and then moved zabbix_get, zabbix_sender and zabbix_agentd to the FreeNAS system. Files are located in user zabbix home directory in bin and sbin folders which and then mounted RO above the /usr/local/bin and sbin folders in FreeNAS using the unionfs. The agent is run as root and from the server side everything apart from low level network discovery seems to work.

    Cheers Mats
  • cscott
    Junior Member
    • Jul 2012
    • 16

    #2
    same issue here, a work around is to add this line to your freebsd config

    UserParameter=net.if.discovery,ifconfig | awk ' BEGIN { print "{\"data\":\[" } /^[a-z0-9]+\:/ { gsub(/\:/,"",$ 1); if ( $ 1 != "lo0" ) print "{ \"{#IFNAME}\":\"" $ 1"\" }," } END { print "{ \"{#IFNAME}\":\"lo0\"} \n]}" } '

    Comment

    • matram
      Junior Member
      • Jul 2012
      • 4

      #3
      Hi CScott,

      Good to hear I am not alone.

      I actually bypassed the discovery altogether and manually configured the network items.

      I was not aware that user parameters could be used in the client to update built in so that was good input and thanks for the awk script.

      Comment

      • cscott
        Junior Member
        • Jul 2012
        • 16

        #4
        to many boxes with different nic names here so i needed to do it 8)

        if the agent responds with zbx_not_supported the oid isnt actually there so you can userparm it. Be careful with agent updates in the future though.

        It shouldnt be to hard to put the function into the agent code itself wouldnt be to hard i just needed something quick

        Comment

        • clahti
          Senior Member
          • Jan 2007
          • 126

          #5
          FreeNAS Howto?

          Hey guys:

          I just recently built four large FreeNAS boxen, I see there is no native precompiled agent for amd65 FreeBSD 8.x. I can also spin up a FreeBSD virtual machine to compile zabbix agent, however the root fs on FreeNAS is read-only, do you have a quick howto on how to get zabbix to run properly on FreeNAS? I would greatly appreciate it!

          Comment

          • matram
            Junior Member
            • Jul 2012
            • 4

            #6
            Zabbix on FreeNAS

            Hi Clathi,
            You can mount the root filesystem as writeable with mount -uw /
            You will still not get write access to all directories.

            The second trick was to create a zabbix user with a home directory on a UFS partition, create bin, sbin and etc directories in the zabbix users home folder and mount them with unionfs on top of the corresponding directories in /usr/local. That allows you to introduce files into /usr/local although it is not writeable.

            I still have to manually copy:
            zabbix-agentd
            unionfs-magic
            to /conf/etc/rc.d every time I upgrade FreeNAS and add the line
            zabbix_agend_enable=YES
            to /conf/base/etc/rc.conf

            It was sometimes since I did this so if you want more detail, let me know and I will dig for more info.

            /Mats

            Comment

            Working...