Ad Widget

Collapse

firewall issue? server not collecting data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gobbledigook
    Junior Member
    • Sep 2011
    • 3

    #1

    firewall issue? server not collecting data

    hi

    new to zabbix, but spent most of yest reading the wiki and setting it up, both server and agent are running... but i think i have an issue with firewall as zabbiz-server is not filling up

    installed zabbix server on ubuntu server 11.04 in virtualbox, hosted on ubuntu 11.04 desktop, and have forwarded the ports on the VM as so:

    8888 > 80 for frontend access
    2000 > 22 for ssh
    both work fine
    10051 > 10051
    10050 > 10050
    these are listening on the respective machines:
    Code:
    zabbix@zabbixvm:~$ netstat -antp | grep zabbix
    (Not all processes could be identified, non-owned process info
     will not be shown, you would have to be root to see it all.)
    tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      2125/zabbix_server
    
    root@DD-WRT:~# netstat -antp | grep zabbix
    tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      18293/zabbix_agentd
    the agent is running on my router a dd-wrt flashed wrt600n, with optware and custom template

    agent conf is:
    Code:
    # This is config file for zabbix_agentd
    # To get more information about ZABBIX, go http://www.zabbix.com
    
    ############ GENERAL PARAMETERS #################
    
    # List of comma delimited IP addresses (or hostnames) of ZABBIX servers. 
    # No spaces allowed. First entry is used for sending active checks.
    # Note that hostnames must resolve hostname->IP address and
    # IP address->hostname.
    
    Server=192.168.1.120
    
    # Server port for sending active checks
    
    # ServerPort=10051
    
    # Unique hostname. Required for active checks.
    
    Hostname=DD-WRT
    
    # Listen port. Default is 10050
    
    #ListenPort=10050
    
    # IP address to bind agent
    # If missing, bind to all available IPs
    
    #ListenIP=127.0.0.1
    
    # Number of pre-forked instances of zabbix_agentd.
    # Default value is 5
    # This parameter must be between 1 and 16
    
    StartAgents=5
    
    # How often refresh list of active checks. 2 minutes by default.
    
    #RefreshActiveChecks=120
    
    # Disable active checks. The agent will work in passive mode listening server.
    
    DisableActive=1
    
    # Enable remote commands for ZABBIX agent. By default remote commands disabled.
    
    #EnableRemoteCommands=1
    
    # Specifies debug level
    # 0 - debug is not created
    # 1 - critical information
    # 2 - error information
    # 3 - warnings
    # 4 - information (default)
    # 5 - for debugging (produces lots of information)
    
    DebugLevel=5
    
    # Name of PID file
    
    PidFile=/tmp/zabbix_agentd.pid
    
    # Name of log file.
    # If not set, syslog will be used
    
    LogFile=/opt/var/log/zabbix_agentd.log
    
    # Spend no more than Timeout seconds on processing
    # Must be between 1 and 30
    
    Timeout=3
    
    ####### USER-DEFINED MONITORED PARAMETERS #######
    # Format: UserParameter=<key>,<shell command>
    # Note that shell command must not return empty string or EOL only
    #UserParameter=system.test,who|wc -l
    ### Set of parameter for monitoring MySQL server (v3.23.42 and later)
    ### Change -u<username> and add -p<password> if required
    #UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
    #UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d":"|cut -f1 -d"T"
    #UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
    #UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
    #UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d":"|cut -f1 -d"O"
    #UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d":"
    #UserParameter=mysql.version,mysql -V
    
    UserParameter=mvcheck, /opt/usr/sbin/mvcheck
    
    UserParameter=listenport[*], netstat -ln | grep -c ':$1 '
    UserParameter=net.netstat, netstat -lnt | sort 
    UserParameter=net.netstat.cksum, netstat -lnt | sort | md5sum | tr -cd 0-9 | cut -b1-10
    
    UserParameter=system.topcpu[*],/opt/usr/sbin/topcpu $1 $2
    UserParameter=net.iptables.cksum,sudo iptables-save | grep -v '^[#:]' | md5sum | tr -cd 0-9 | cut -b1-10
    UserParameter=net.ipv4.cksum,ifconfig | grep -B1 ' inet ' | md5sum | tr -cd 0-9 | cut -b1-10
    UserParameter=net.ipv4,ifconfig | grep -B1 ' inet ' | grep -oE '(^[a-z0-9:]+|addr:[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'
    UserParameter=net.connections, sudo grep -c . /proc/net/ip_conntrack
    
    UserParameter=nvram.cksum, sudo /usr/sbin/nvram show 2>/dev/null | grep -vE '^(wan_[ig][aep]|forward_|traff|dnsmasq_lease_|http_client_)' | sort | md5sum | tr -cd '0-9' | cut -b1-10
    UserParameter=nvram.free,  sudo /usr/sbin/nvram show 2>&1 1>/dev/null | grep -o ' ([0-9]*' | tr -cd '0-9'
    
    UserParameter=vfs.file.regcount[*],sudo /opt/usr/sbin/regcount "$1" "$2" "$3" "$4" "$5"
    UserParameter=vfs.file.regtop[*],  sudo /opt/usr/sbin/regtop   "$1" "$2" "$3" "$4" "$5" "$6"
    and nothing interesting in the debug log:
    Code:
    root@DD-WRT:~# cat /opt/var/log/zabbix_agentd.log     
     17500:20110831:180805 One child process died. Exiting ...
     17500:20110831:180807 ZABBIX Agent stopped. ZABBIX 1.6.2.
     18293:20110831:180811 zabbix_agentd started. ZABBIX 1.6.2.
     18293:20110831:180811 cfg: para: [Server] val [192.168.1.120]
     18293:20110831:180811 cfg: para: [Hostname] val [dd-wrt]
     18293:20110831:180811 cfg: para: [StartAgents] val [5]
     18293:20110831:180811 cfg: para: [DisableActive] val [1]
     18293:20110831:180811 cfg: para: [DebugLevel] val [5]
     18293:20110831:180811 cfg: para: [PidFile] val [/tmp/zabbix_agentd.pid]
     18293:20110831:180811 cfg: para: [LogFile] val [/opt/var/log/zabbix_agentd.log]
     18293:20110831:180811 cfg: para: [Timeout] val [3]
     18293:20110831:180811 cfg: para: [UserParameter] val [mvcheck, /opt/usr/sbin/mvcheck]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'mvcheck, /opt/usr/sbin/mvcheck'
     18293:20110831:180811 cfg: para: [UserParameter] val[listenport[*], netstat -ln | grep -c ':$1 ']
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'listenport[*], netstat -ln | grep -c ':$1 ''
     18293:20110831:180811 cfg: para: [UserParameter] val [net.netstat, netstat -lnt | sort]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'net.netstat, netstat -lnt | sort'
     18293:20110831:180811 cfg: para: [UserParameter] val [net.netstat.cksum, netstat -lnt | sort | md5sum | tr -cd 0-9 | cut -b1-10]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'net.netstat.cksum, netstat -lnt | sort | md5sum | tr -cd 0-9 | cut -b1-10'
     18293:20110831:180811 cfg: para: [UserParameter] val [system.topcpu[*],/opt/usr/sbin/topcpu $1 $2]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'system.topcpu[*],/opt/usr/sbin/topcpu $1 $2'
     18293:20110831:180811 cfg: para: [UserParameter] val [net.iptables.cksum,sudo iptables-save | grep -v '^[#:]' | md5sum | tr -cd 0-9 | cut -b1-10]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'net.iptables.cksum,sudo iptables-save | grep -v '^[#:]' | md5sum | tr -cd 0-9 | cut -b1-10'
     18293:20110831:180811 cfg: para: [UserParameter] val [net.ipv4.cksum,ifconfig | grep -B1 ' inet ' | md5sum | tr -cd 0-9 | cut -b1-10]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'net.ipv4.cksum,ifconfig | grep -B1 ' inet ' | md5sum | tr -cd 0-9 | cut -b1-10'
     18293:20110831:180811 cfg: para: [UserParameter] val [net.ipv4,ifconfig | grep -B1 ' inet ' | grep -oE '(^[a-z0-9:]+|addr:[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)']
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'net.ipv4,ifconfig | grep -B1 ' inet ' | grep -oE '(^[a-z0-9:]+|addr:[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)''
     18293:20110831:180811 cfg: para: [UserParameter] val [net.connections, sudo grep -c . /proc/net/ip_conntrack]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'net.connections, sudo grep -c . /proc/net/ip_conntrack'
     18293:20110831:180811 cfg: para: [UserParameter] val [nvram.cksum, sudo /usr/sbin/nvram show 2>/dev/null | grep -vE '^(wan_[ig][aep]|forward_|traff|dnsmasq_lease_|http_client_)' | sort | md5sum | tr -cd '0-9' | cut -b1-10]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'nvram.cksum, sudo /usr/sbin/nvram show 2>/dev/null | grep -vE '^(wan_[ig][aep]|forward_|traff|dnsmasq_lease_|http_client_)' | sort | md5sum | tr -cd '0-9' | cut -b1-10'
     18293:20110831:180811 cfg: para: [UserParameter] val [nvram.free,  sudo /usr/sbin/nvram show 2>&1 1>/dev/null | grep -o ' ([0-9]*' | tr -cd '0-9']
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'nvram.free,  sudo /usr/sbin/nvram show 2>&1 1>/dev/null | grep -o ' ([0-9]*' | tr -cd '0-9''
     18293:20110831:180811 cfg: para: [UserParameter] val [vfs.file.regcount[*],sudo /opt/usr/sbin/regcount "$1" "$2" "$3" "$4" "$5"]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'vfs.file.regcount[*],sudo /opt/usr/sbin/regcount "$1" "$2" "$3" "$4" "$5"'
     18293:20110831:180811 cfg: para: [UserParameter] val [vfs.file.regtop[*],  sudo /opt/usr/sbin/regtop   "$1" "$2" "$3" "$4" "$5" "$6"]
     18293:20110831:180811 Accepted configuration parameter: 'UserParameter' = 'vfs.file.regtop[*],  sudo /opt/usr/sbin/regtop   "$1" "$2" "$3" "$4" "$5" "$6"'
     18294:20110831:180811 zabbix_agentd collector started
     18295:20110831:180811 zabbix_agentd listener started
     18296:20110831:180811 zabbix_agentd listener started
     18297:20110831:180811 zabbix_agentd listener started
     18298:20110831:180811 zabbix_agentd listener started
    on the zabbix-server i have set up dd-wrt host as:
    name: dd-wrt
    in group: linux servers
    ip add: 192.168.1.1
    port: 10050

    and linked the dd-wrt template.

    so do i need to forward the 10050/10051 on the router? or the ubuntu desktop? i thought adding the port forwards to the VM sorted that side out and as it is reporting back through my LAN i figured don't need any forwards on the router side.... but something somewhere is stopping it !!!

    my second attempt at getting this going (gave up 6 odd months ago) and feel as if i'm so close

    any help appreciated, thanx!
  • gobbledigook
    Junior Member
    • Sep 2011
    • 3

    #2
    so... now i'm thinking it may be something to do with my agentd conf. i tried commenting out the hostname but got an error when i restarted the daemon.

    what exactly should go in these values??

    Server=192.168.1.120 <-- this is the IP of the host machine running the VM,

    # Server port for sending active checks

    # ServerPort=10051

    # Unique hostname. Required for active checks.

    Hostname=DD-WRT <-- this is the hostname of the router... is this correct? should it be the hostname of the host machine running the VM? (have changed and commented out but no difference.

    # Listen port. Default is 10050

    #ListenPort=10050

    # IP address to bind agent
    # If missing, bind to all available IPs

    #ListenIP=127.0.0.1 <-- should i be changing this the the IP of the zabbix host?

    any pointers would be appreciated...

    Comment

    • frater
      Senior Member
      • Oct 2010
      • 340

      #3
      Install the zabbix agent on your Windows machine and configure a host on the zabbix machine.
      And aren't you monitoring the zabbix server itself?

      From the zabbix machine you should be able to connect to the zabbix agent using
      Code:
      telnet 192.168.1.1 10050
      Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

      Comment

      • gobbledigook
        Junior Member
        • Sep 2011
        • 3

        #4
        hey frater,

        telnet just hangs when i try from the zabbix VM but on my laptop the connection is refused, telnet is enabled on the router.

        i i'll install the agent locally to make sure its not a config problem.

        i can't ping hostname zabbixvm, so i put the VM's host hostname here? ie in my case server? i can ping the router from the zabbix VM though.

        edit:
        ok the zabbix-server isn't getting anything from the agent on the local machine.
        haven't touched the config of the agent
        just went to config > hosts > add host:
        name: zabbix-server
        in group: zabbix-servers
        ip add: 0.0.0.0
        port: 10050

        and linked template linux.

        ok this is telnet from my laptop the the zabbixvm:
        Code:
        dan@mini-ubuntu:~$ telnet 192.168.1.120 10050
        Trying 192.168.1.120...
        telnet: Unable to connect to remote host: Connection refused
        dan@mini-ubuntu:~$ telnet 192.168.1.120 10051
        Trying 192.168.1.120...
        Connected to 192.168.1.120.
        Escape character is '^]'.
        Connection closed by foreign host.
        Last edited by gobbledigook; 04-09-2011, 21:45.

        Comment

        Working...