Ad Widget

Collapse

Zabbix sender hostname domain ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • system
    Junior Member
    • Aug 2009
    • 5

    #1

    Zabbix sender hostname domain ?

    Zabbix sender fails when used with uname -n:

    Code:
    [root@host bin]# /usr/local/sbin/zabbix_sender -s `uname -n` -z zbxserver -k mykey -o `date +%s`
    Info from server: Failed 1
    Because uname returns hostname + domain :
    Code:
    [root@host bin]# uname -n
    myhost.mydomain.fr

    It works when specifying hostname without domain manually :
    Code:
    [root@host bin]# /usr/local/sbin/zabbix_sender -s myhost -z zbxserver -k mykey -o `date +%s`
    Info from server: "Processed 1
    In opposition to what the doc states, it does not work with IP :

    Code:
    [root@host bin]# /usr/local/sbin/zabbix_sender -s 10.0.13.19 -z zbxserver -k mykey -o `date +%s`
    Info from server: "Failed 1
    In Zabbix web interface, in hosts configuration, I tried to specify the domain, either in DNS, or in Name field. None solved the problem.

    Do you have any idea ? Is it wrong to use uname in zabbix sender commands ? How would you make your scripts generic then ?
  • tighep
    Senior Member
    • Dec 2007
    • 124

    #2
    instead of uname -n use hostname -s

    Comment

    • system
      Junior Member
      • Aug 2009
      • 5

      #3
      I thought of using hostname, but then I realized I could have several domains for one hostname...
      webmail.mydomain.fr
      webmail.myotherdomain.fr
      ...

      Will Zabbix be able to distinguish where it comes from ?

      Comment

      • tighep
        Senior Member
        • Dec 2007
        • 124

        #4
        The -s flag should match what Zabbix knows the system as, in my case these are short hostnames. In your case it appears that a fully qualified name is most appropriate, but it appears that Zabbix does not know your systems that way?

        Comment

        • system
          Junior Member
          • Aug 2009
          • 5

          #5
          Thanks for your answers.
          I'll make it with hostname -s, should be enough.

          Comment

          Working...