PDA

View Full Version : got empty string from...


mkzimms
26-04-2008, 21:46
i receive a "Got empty string from [LAPTOP] IP [192.168.1.111] Parameter [agent.ping]" from my laptop which is loaded with ubuntu hardy. i installed the agent with apt-get install zabbix-agent and configured the agent.conf and agentd.conf for my server configuration with no luck.

i also get avalibility unknown, for my other linux server. so far i have not gotten any remote computer to communicate with my zabbix server, but the local monitoring on the zabbix server works flawlessly.

let me know which files you need to see to help me troubleshoot. i have no firewalls setup internally. im using 1.4.5 as the server and both agents were installed from the ubuntu hardy repositories, im not sure which version the repositories contain.

nelsonab
27-04-2008, 02:07
Go back and make sure to verify your settings. Pay close attention to the server field in your agent(d).conf file. I prefer to put an IP address in this field to avoid any reverse DNS issues. Make sure this field matches the IP address your zabbix server connections are coming from.

Another thing to check is from your server telnet to the agent... telnet host 10050

then type in a key to monitor such as the following
system.cpu.load[,avg1]

type the key on one line and press enter after. If your session gets closed without showing anything then it's likely a misconfiguration in your agent(d).conf file. Otherwise you should see a number.

If you can't connect to the agent, then there's a routing and or firewall issue. If you can connect and you do get a number back, everything *should* be working. In that case check the log files, usually found in /tmp but you may find them in the usual /var/log.

Hopefully this gives you some ideas of where to start looking.

mkzimms
27-04-2008, 05:16
telneted in and this is what i receive...


mikez@twinkie:$ telnet
telnet> open
(to) 192.168.1.111 10050
Trying 192.168.1.111...
Connected to 192.168.1.111.
Escape character is '^]'.
system.cpu.load[,avg1]
ZBXD0.100000Connection closed by foreign host.


Here is a copy of my zabbix_agentd.conf...question should this line be my servers hostname or the computer i want to monitor hostname?

# Unique hostname. Required for active checks.
Hostname=mikez-hardy


mikez@mikez-hardy:/etc/zabbix$ sudo cat zabbix_agentd.conf
# 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.50

# Server port for sending active checks

#ServerPort=10051

# Unique hostname. Required for active checks.

Hostname=mikez-hardy

# 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=3

# Name of PID file

PidFile=/var/run/zabbix-agent/zabbix_agentd.pid

# Name of log file.
# If not set, syslog will be used

LogFile=/var/log/zabbix-agent/zabbix_agentd.log

# Maximum size of log file in MB. Set to 0 to disable automatic log rotation.
#LogFileSize=1

# 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



Here is my zabbix_server.conf


mikez@twinkie:/etc/zabbix$ sudo cat zabbix_server.conf
[sudo] password for mikez:
# This is config file for ZABBIX server process
# To get more information about ZABBIX,
# go http://www.zabbix.com

############ GENERAL PARAMETERS #################

# This defines unique NodeID in distributed setup,
# Default value 0 (standalone server)
# This parameter must be between 0 and 999
#NodeID=0

# Number of pre-forked instances of pollers
# Default value is 5
# This parameter must be between 0 and 255
#StartPollers=5

# Number of pre-forked instances of pollers for unreachable hosts
# Default value is 1
# This parameter must be between 0 and 255
#StartPollersUnreachable=1

# Number of pre-forked instances of trappers
# Default value is 5
# This parameter must be between 0 and 255
#StartTrappers=5

# Number of pre-forked instances of ICMP pingers
# Default value is 1
# This parameter must be between 0 and 255
#StartPingers=1

# Number of pre-forked instances of discoverers
# Default value is 1
# This parameter must be between 0 and 255
#StartDiscoverers=1

# Number of pre-forked instances of HTTP pollers
# Default value is 1
# This parameter must be between 0 and 255
#StartHTTPPollers=1

# Listen port for trapper. Default port number is 10051. This parameter
# must be between 1024 and 32767

ListenPort=10051

# Listen interface for trapper. Trapper will listen all network interfaces
# if this parameter is missing.

#ListenIP=127.0.0.1
ListenIP=192.168.1.50

# How often ZABBIX will perform housekeeping procedure
# (in hours)
# Default value is 1 hour
# Housekeeping is removing unnecessary information from
# tables history, alert, and alarms
# This parameter must be between 1 and 24

#HousekeepingFrequency=1

# How often ZABBIX will try to send unsent alerts
# (in seconds)
# Default value is 30 seconds
SenderFrequency=30

# Uncomment this line to disable housekeeping procedure
#DisableHousekeeping=1

# Specifies debug level
# 0 - debug is not created
# 1 - critical information
# 2 - error information
# 3 - warnings (default)
# 4 - for debugging (produces lots of information)

DebugLevel=3

# Specifies how long we wait for agent response (in sec)
# Must be between 1 and 30
Timeout=5

# Specifies how many seconds trapper may spend processing new data
# Must be between 1 and 30
#TrapperTimeout=5

# After how many seconds of unreachability treat a host as unavailable
#UnreachablePeriod=45

# How ofter check host for availability during the unreachability period
#UnavailableDelay=15

# How ofter check host for availability during the unavailability period
#UnavailableDelay=60

# Name of PID file

PidFile=/var/tmp/zabbix_server.pid

# Name of log file
# If not set, syslog is used

LogFile=/tmp/zabbix_server.log

# Maximum size of log file in MB. Set to 0 to disable automatic log rotation.
#LogFileSize=1

# Location for custom alert scripts
AlertScriptsPath=/home/zabbix/bin/

# Location of external scripts
#ExternalScripts=/etc/zabbix/externalscripts

# Location of fping. Default is /usr/sbin/fping
# Make sure that fping binary has root permissions and SUID flag set
#FpingLocation=/usr/sbin/fping

# Location of fping6. Default is /usr/sbin/fping6
# Make sure that fping binary has root permissions and SUID flag set
#Fping6Location=/usr/sbin/fping6

# Frequency of ICMP pings (item keys 'icmpping' and 'icmppingsec'). Defauls is 60 seconds.
#PingerFrequency=60

# Database host name
# Default is localhost

#DBHost=localhost

# Database name
# SQLite3 note: path to database file must be provided. DBUser and DBPassword are ignored.
DBName=zabbix

# Database user

DBUser=root

# Database password
# Comment this line if no password used

#DBPassword=<password>

# Connect to MySQL using Unix socket?

#DBSocket=/tmp/mysql.sock



and here is what i get from the computer i want to monitor zabbix_agentd.log


8129:20080426:231212 zabbix_agentd started. ZABBIX 1.4.2.
8131:20080426:231212 zabbix_agentd collector started
8132:20080426:231212 zabbix_agentd listener started
8133:20080426:231212 zabbix_agentd listener started
8134:20080426:231212 zabbix_agentd listener started
8135:20080426:231212 zabbix_agentd active check started [192.168.1.50:10051]
8135:20080426:231212 Getting list of active checks failed. Will retry after 60 seconds


im so frustrated.

nelsonab
27-04-2008, 17:54
I had a similar situation a while ago. This was the thread:
http://www.zabbix.com/forum/showthread.php?t=6538

Try upping the debug level on the agent to 5 and restart the agent. You might find better information in the agent log then. If that does not work try upping the debug level to 5 on the server for a little while. The server will spit out *a lot* of debug information.

In the host configuration screen does the hostname field matches the one in the agent.conf? Also are you connecting to the agent using the DNS Name or IP address?

mkzimms
28-04-2008, 05:39
im connecting using IP... this is interesting though

trying to telnet from the agent computer to the server computer.


mikez@mikez-hardy:/var/log/zabbix-agent$ telnet
telnet> open
(to) 192.168.1.50 10051
Trying 192.168.1.50...
telnet: Unable to connect to remote host: Connection refused


the log didn't show me anything special other than it cant connect to the server, interesting. but to give a "empty string from" wouldn't it have to connect at somepoint?


6486:20080427:232448 zabbix_agentd started. ZABBIX 1.4.2.
6487:20080427:232448 zabbix_agentd collector started
6488:20080427:232448 zabbix_agentd listener started
6489:20080427:232448 zabbix_agentd listener started
6490:20080427:232448 zabbix_agentd listener started
6491:20080427:232448 zabbix_agentd active check started [192.168.1.50:10051]
6491:20080427:232448 In init_active_metrics()
6491:20080427:232448 In refresh_metrics('192.168.1.50',10051)
6491:20080427:232448 get_active_checks('192.168.1.50',10051)
6491:20080427:232448 Get active checks error: Cannot connect to [192.168.1.50:10051] [Connection refused]
6491:20080427:232448 Getting list of active checks failed. Will retry after 60 seconds


i dont understand, i do not have any firewall setup on either and both computers are on the same subnet of the internal LAN.

nelsonab
28-04-2008, 07:57
Interesting... Let's confirm the basics just in case. You say the subnetting is configured the same, and the router is also the same? I'm assuming both machines can leave the network with no issue? Can you ssh between the computers?

Try running "netstat -tln" on both the server and agent. That will tell you what TCP ports are currently in a listening state. You should see the appropriate ports open for each system.

Anyone else, other ideas?

bisbell
13-05-2008, 00:18
I just solved a problem on my systems that were having the same "agent.ping" error message. What I had to do was add the router as a zabbix server in my zabbix_agentd.conf file on the client side.
192.168.1.1 is the router on the zabbix client side between the .1 and .64 networks.
192.168.1.119 is the actual zabbix server.
192.168.1.4 is the client IP.

/etc/zabbix/zabbix_agentd.conf
.
.
Server=192.168.1.119,192.168.1.1

.
.