Ad Widget

Collapse

Problem with zabbix agent - server and agent on the same machine

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • req
    Junior Member
    • Oct 2010
    • 2

    #1

    Problem with zabbix agent - server and agent on the same machine

    Welcome,
    it's my first post on this forum, I'm also a new user of debian and new user of zabbix... so be patient if I make big mistakes...

    I've some problems with connection (or configuration?) of zabbix agent in my network on the server side. I've 2 computers:
    computer1 - debian with installed server and agent
    computer2 - windows xp with installed agent

    Computer1 has no problem with monitoring computer2, as I can see agent is running on the windows machine and it's reporting fine,so i think the server configuration on computer1 is ok.

    Problem is with monitoring the computer1 machine (agent+server). I think that something wrong is on the agent side.

    Status is
    Code:
    Server Zabbix server is unreachable
    zabbix_server.log
    Code:
    error: Get value from agent failed: Cannot connect to [127.0.0.1:10050] [Connection refused]
    When I type 'ps aux | grep zabbix' i receive

    Code:
    debian:/# ps aux | grep zabbix
    zabbix    3814  0.0  0.2  47860  2104 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3815  0.0  0.1  47864  1560 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3816  0.0  0.2  49780  2776 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3817  0.0  0.2  49780  2768 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3818  0.0  0.2  49780  2764 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3819  0.0  0.2  49780  2764 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3820  0.0  0.2  49780  2764 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3821  0.0  0.1  47936  1452 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3822  0.0  0.1  47924  1292 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3823  0.0  0.1  47924  1292 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3824  0.0  0.1  47924  1292 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3825  0.0  0.1  47936  1452 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3827  0.0  0.1  48480  1248 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3829  0.0  0.1  47860  1224 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3831  0.1  0.1  47860  1396 ?        SN   14:13   0:05 /usr/sbin/zabbix_server
    zabbix    3833  0.0  0.1  47860  1248 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3835  0.0  0.1  47860  1228 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3837  0.0  0.2  49372  2496 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3838  0.0  0.1  47860  1224 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3840  0.0  0.1  47860  1224 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3842  0.0  0.1  47860  1224 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3844  0.0  0.1  47860  1224 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3846  0.0  0.1  47860  1236 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    zabbix    3848  0.0  0.1  47860  1236 ?        SN   14:13   0:00 /usr/sbin/zabbix_server
    root      3990  0.0  0.0   3152   780 pts/1    S+   15:16   0:00 grep zabbix
    debian:/#
    As I can see, the agent is not running (Am I right? ). I have no idea how to start zabbix_agent, i've tried:

    /
    Code:
    etc/init.d/zabbix-agent start
    but I don't get any reply after typing this...
    I've tried to config some files but with no result...

    I would be grateful for some tips...

    Edit. Zabbix version is 1.8.3
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    See zabbix-agent logs (/var/log/zabbix-agent). I predict problem with configuration of agent.
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    • req
      Junior Member
      • Oct 2010
      • 2

      #3
      Originally posted by jan.garaj
      See zabbix-agent logs (/var/log/zabbix-agent). I predict problem with configuration of agent.
      Thank you for your reply jan.garaj. Problem is that I don't have any agent log file in /var/log/zabbix-agent and in /tmp/zabbix_agentd.log (this location is in my zabbix_agentd.conf file). I have only the log file of server and it says about agent this
      Code:
      Item [Zabbix server:net.if.in[eth1,bytes]] error: Get value from agent failed: Cannot connect to [127.0.0.1:10050] [Connection refused$
      This are my agent files.
      /etc/zabbix/zabbix_agent.conf
      Code:
      # This is a config file for zabbix_agent
      # To get more information about Zabbix visit http://www.zabbix.com
      
      ### Option: Server
      #	IP address of Zabbix server
      #	Connections from other hosts will be denied
      #	If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
      #
      # Mandatory: yes
      # Default:
      # Server=
      
      Server=127.0.0.1
      
      ### Option: Timeout
      #	Spend no more than Timeout seconds on processing
      #
      # Mandatory: no
      # Range: 1-30
      # Default:
      Timeout=3
      
      
      ####### USER-DEFINED MONITORED PARAMETERS #######
      
      ### Option: UnsafeUserParameters
      #	Allow all characters to be passed in arguments to user-defined parameters.
      #	0 - do not allow
      #	1 - allow
      #
      # Mandatory: no
      # Default:
      # UnsafeUserParameters=0
      
      ### Option: UserParameter
      #	User-defined parameter to monitor. There can be several user-defined parameters.
      #	Format: UserParameter=<key>,<shell command>
      #	Note that shell command must not return empty string or EOL only.
      #	Example: UserParameter=system.test,who|wc -l
      #UserParameter=system.test,who|wc -l
      ### Set of parameters 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
      /e/tc/zabbix/zabbix_agentd
      Code:
      # base zabbix dir
      # BASEDIR=/opt/zabbix
      BASEDIR=/usr/local
      # pid file (as of 1.0 beta 10)
      PIDFILE=/var/tmp/zabbix_agentd.pid
      # binary file
      ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd
      /etc/zabbix/zabbix_agentd.conf
      Code:
      # This is a config file for Zabbix Agent (Unix)
      # To get more information about Zabbix, visit http://www.zabbix.com
      
      ############ GENERAL PARAMETERS #################
      
      ### Option: PidFile
      #	Name of PID file.
      #
      # Mandatory: no
      # Default:
      PidFile=/tmp/zabbix_agentd.pid
      
      ### Option: LogFile
      #	Name of log file.
      #	If not set, syslog is used.
      #
      # Mandatory: no
      # Default:
      # LogFile=
      
      LogFile=/tmp/zabbix_agentd.log
      
      ### Option: LogFileSize
      #	Maximum size of log file in MB.
      #	0 - disable automatic log rotation.
      #
      # Mandatory: no
      # Range: 0-1024
      # Default:
      # LogFileSize=1
      
      ### Option: DebugLevel
      #	Specifies debug level
      #	0 - no debug
      #	1 - critical information
      #	2 - error information
      #	3 - warnings
      #	4 - for debugging (produces lots of information)
      #
      # Mandatory: no
      # Range: 0-4
      # Default:
      DebugLevel=5
      
      ### Option: SourceIP
      #	Source IP address for outgoing connections.
      #
      # Mandatory: no
      # Default:
      # SourceIP=
      
      ### Option: EnableRemoteCommands
      #	Whether remote commands from Zabbix server are allowed.
      #	0 - not allowed
      #	1 - allowed
      #
      # Mandatory: no
      # Default:
      # EnableRemoteCommands=0
      
      ### Option: LogRemoteCommands
      #	Enable logging of executed shell commands as warnings
      #	0 - disabled
      #	1 - enabled
      #
      # Mandatory: no
      # Default:
      # LogRemoteCommands=0
      
      ##### Passive checks related
      
      ### Option: Server
      #	List of comma delimited IP addresses (or hostnames) of Zabbix servers.
      #	No spaces allowed. First entry is used for receiving list of and sending active checks.
      #	Note that hostnames must resolve hostname->IP address and IP address->hostname.
      #	If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
      #
      # Mandatory: yes
      # Default:
      # Server=
      
      Server=127.0.0.1
      
      ### Option: Hostname
      #	Unique, case sensitive hostname.
      #	Required for active checks and must match hostname as configured on the server.
      #
      # Default:
      # Hostname=system.uname
      
      Hostname=Zabbix Server
      
      ### Option: ListenPort
      #	Agent will listen on this port for connections from the server.
      #
      # Mandatory: no
      # Range: 1024-32767
      # Default:
      #ListenPort=10050
      
      ### Option: ListenIP
      #	List of comma delimited IP addresses that the agent should listen on.
      #
      # Mandatory: no
      # Default:
      # ListenIP=0.0.0.0
      
      ListenIP=127.0.0.1
      
      ### Option: DisablePassive
      #	Disable passive checks. The agent will not listen on any TCP port.
      #	Only active checks will be processed.
      #	0 - do not disable
      #	1 - disable
      #
      # Mandatory: no
      # Default:
      # DisablePassive=0
      
      ##### Active checks related
      
      ### Option: DisableActive
      #	Disable active checks. The agent will work in passive mode listening for server.
      #
      # Mandatory: no
      # Default:
      # DisableActive=0
      
      # DisableActive=1
      
      ### Option: ServerPort
      #	Server port for retrieving list of and  sending active checks.
      #
      # Mandatory: no
      # Default:
      # ServerPort=10051
      
      ### Option: RefreshActiveChecks
      #	How often list of active checks is refreshed, in seconds.
      #
      # Mandatory: no
      # Range: 60-3600
      # Default:
      # RefreshActiveChecks=120
      
      ### Option: BufferSend
      #	Do not keep data longer than N seconds in buffer.
      #
      # Mandatory: no
      # Range: 1-3600
      # Default:
      # BufferSend=5
      
      ### Option: BufferSize
      #	Maximum number of values in a memory buffer. The agent will send
      #	all collected data to Zabbix Server or Proxy if the buffer is full.
      #
      # Mandatory: no
      # Range: 2-65535
      # Default:
      # BufferSize=100
      
      ### Option: MaxLinesPerSecond
      #	Maximum number of new lines the agent will send per second to Zabbix Server
      #	or Proxy processing 'log' and 'logrt' active checks.
      #	The provided value will be overridden by the parameter 'maxlines',
      #	provided in 'log' or 'logrt' item keys.
      #
      # Mandatory: no
      # Range: 1-1000
      # Default:
      # MaxLinesPerSecond=100
      
      
      ############ ADVANCED PARAMETERS #################
      
      ### Option: StartAgents
      #	Number of pre-forked instances of zabbix_agentd that process passive checks.
      #
      # Mandatory: no
      # Range: 1-16
      # Default:
      StartAgents=5
      
      ### Option: Timeout
      #	Spend no more than Timeout seconds on processing
      #
      # Mandatory: no
      # Range: 1-30
      # Default:
      Timeout=3
      
      ### Option: Include
      #	You may include individual files or all files in a directory in the configuration file.
      #
      # Mandatory: no
      # Default:
      # Include=
      
      # Include=/etc/zabbix/zabbix_agent.userparams.conf
      # Include=/etc/zabbix/zabbix_agentd/
      
      
      ####### USER-DEFINED MONITORED PARAMETERS #######
      
      ### Option: UnsafeUserParameters
      #	Allow all characters to be passed in arguments to user-defined parameters.
      #	0 - do not allow
      #	1 - allow
      #
      # Mandatory: no
      # Range: 0-1
      # Default:
      # UnsafeUserParameters=0
      
      ### Option: UserParameter
      #	User-defined parameter to monitor. There can be several user-defined parameters.
      #	Format: UserParameter=<key>,<shell command>
      #	Note that shell command must not return empty string or EOL only.
      #	Example: UserParameter=system.test,who|wc -l
      #UserParameter=system.test,who|wc -l
      ### Set of parameters 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

      Comment

      • jan.garaj
        Senior Member
        Zabbix Certified Specialist
        • Jan 2010
        • 506

        #4
        Your agent cannot start - agent is not in "ps -aux | grep zabbix".
        Set ListenIP=0.0.0.0 in server configuration - server will work on all network interfaces (also 127.0.0.1) and restart server.
        Try disable firewall.
        Check write permission for user zabbix to /var/tmp /tmp

        Set DebugLevel=4 (i not understand what is level 5) in /etc/zabbix/zabbix_agentd.conf
        and try start agent (as root) "/etc/init.d/zabbix-agent start" or direct "/usr/sbin/zabbix-agentd" and see your /tmp/zabbix_agentd.log
        Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
        My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

        Comment

        Working...