Impossible de se connecter à [Connexion refusée] zabbix
Solved
naby007
-
Arooo -
Arooo -
Hello,
I am doing an internship and my tutor asked me to install and understand Zabbix. The only problem is that some hosts become available and others show the message Cannot connect to [ ] [Connection refused]
If someone could help me, please
Thank you in advance
I am doing an internship and my tutor asked me to install and understand Zabbix. The only problem is that some hosts become available and others show the message Cannot connect to [ ] [Connection refused]
If someone could help me, please
Thank you in advance
Configuration: Windows XP Internet Explorer 6.0
7 réponses
YESSSSSSSSS, that was it!!
now both are working and therefore, my PC has IP: 10.150.36.44
my file "zabbix_agent.conf":
# This is config file for zabbix_agent
# To get more information about ZABBIX,
# go https://www.zabbix.com/
# IP address of ZABBIX server
# Connections from other hosts will be denied
#Server=10.150.36.44
Server=127.0.0.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
my file "zabbix_agentd.conf":
# This is config file for zabbix_agentd
# To get more information about ZABBIX, go https://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=127.0.0.1
# Server port for sending active checks
#ServerPort=10051
ServerPort=10051
# Unique hostname. Required for active checks.
Hostname=localhost
# Listen port. Default is 10050
#ListenPort=10050
ListenPort=10050
# IP address to bind agent
# If missing, bind to all available IPs
#ListenIP=127.0.0.1
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. in seconds
RefreshActiveChecks=10
# 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 (default)
# 4 - for debugging (produces lots of information)
DebugLevel=4
# 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
# 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
my file "zabbix_server.conf":
# This is config file for ZABBIX server process
# To get more information about ZABBIX,
# go https://www.zabbix.com/
############ GENERAL PARAMETERS #################
# This defines which server this is.
# Default value 1
# This parameter must be between 1 and 255
Server=1
# Number of pre-forked instances of pollers
# Default value is 6
# This parameter must be between 5 and 255
StartPollers=6
# Number of pre-forked instances of trappers
# Default value is 5
# This parameter must be between 2 and 255
StartTrappers=5
# Listen interface for trapper. Trapper will listen all network interfaces
# if this parameter is missing.
#ListenIP=127.0.0.1
# Listen port for trapping. Default port number is 10051. This parameter
# must be between 1024 and 32767
ListenPort=10051
# 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 (in sec)
# Must be between 1 and 30
Timeout=5
# After how many seconds of unavailability treat a host as unavailable
UnavailablePeriod=20
# Name of PID file
PidFile=/var/run/zabbix-server/zabbix_server.pid
# Name of log file
# If not set, syslog is used
LogFile=/var/log/zabbix-server/zabbix_server.log
#Location for custom alert scripts
AlertScriptsPath=/usr/local/sbin/
#Location of 'fping. Default is /usr/sbin/fping
FpingLocation=/usr/bin/fping
# Frequency of ICMP pings. Default is 30 seconds.
#PingerFrequency=30
# Database host name
# Default is localhost
DBHost=
# Database name
DBName=zabbix
# Database user
DBUser=zabbix
# Database password
# Comment this line if no password used
DBPassword=toto
# Connect to MySQL using Unix socket?
#DBSocket=/tmp/mysql.sock
with
/etc/init.d/zabbix-server restart
and
/etc/init.d/zabbix-agent restart
in a terminal to restart everything and take the new configuration into account.
Note that if I put back the address: 10.150.36.44 in the config, the error "Connection reset by peer." comes back
so that's why I left it in the files but commented out, so that everyone can see the mistake not to make.
I hope this will help as many people as possible. Bye
now both are working and therefore, my PC has IP: 10.150.36.44
my file "zabbix_agent.conf":
# This is config file for zabbix_agent
# To get more information about ZABBIX,
# go https://www.zabbix.com/
# IP address of ZABBIX server
# Connections from other hosts will be denied
#Server=10.150.36.44
Server=127.0.0.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
my file "zabbix_agentd.conf":
# This is config file for zabbix_agentd
# To get more information about ZABBIX, go https://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=127.0.0.1
# Server port for sending active checks
#ServerPort=10051
ServerPort=10051
# Unique hostname. Required for active checks.
Hostname=localhost
# Listen port. Default is 10050
#ListenPort=10050
ListenPort=10050
# IP address to bind agent
# If missing, bind to all available IPs
#ListenIP=127.0.0.1
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. in seconds
RefreshActiveChecks=10
# 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 (default)
# 4 - for debugging (produces lots of information)
DebugLevel=4
# 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
# 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
my file "zabbix_server.conf":
# This is config file for ZABBIX server process
# To get more information about ZABBIX,
# go https://www.zabbix.com/
############ GENERAL PARAMETERS #################
# This defines which server this is.
# Default value 1
# This parameter must be between 1 and 255
Server=1
# Number of pre-forked instances of pollers
# Default value is 6
# This parameter must be between 5 and 255
StartPollers=6
# Number of pre-forked instances of trappers
# Default value is 5
# This parameter must be between 2 and 255
StartTrappers=5
# Listen interface for trapper. Trapper will listen all network interfaces
# if this parameter is missing.
#ListenIP=127.0.0.1
# Listen port for trapping. Default port number is 10051. This parameter
# must be between 1024 and 32767
ListenPort=10051
# 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 (in sec)
# Must be between 1 and 30
Timeout=5
# After how many seconds of unavailability treat a host as unavailable
UnavailablePeriod=20
# Name of PID file
PidFile=/var/run/zabbix-server/zabbix_server.pid
# Name of log file
# If not set, syslog is used
LogFile=/var/log/zabbix-server/zabbix_server.log
#Location for custom alert scripts
AlertScriptsPath=/usr/local/sbin/
#Location of 'fping. Default is /usr/sbin/fping
FpingLocation=/usr/bin/fping
# Frequency of ICMP pings. Default is 30 seconds.
#PingerFrequency=30
# Database host name
# Default is localhost
DBHost=
# Database name
DBName=zabbix
# Database user
DBUser=zabbix
# Database password
# Comment this line if no password used
DBPassword=toto
# Connect to MySQL using Unix socket?
#DBSocket=/tmp/mysql.sock
with
/etc/init.d/zabbix-server restart
and
/etc/init.d/zabbix-agent restart
in a terminal to restart everything and take the new configuration into account.
Note that if I put back the address: 10.150.36.44 in the config, the error "Connection reset by peer." comes back
so that's why I left it in the files but commented out, so that everyone can see the mistake not to make.
I hope this will help as many people as possible. Bye