need help with Zabbix server
-
/var/log/zabbix_agentd.log
It said 127.0.0.1 was refusing connection. I took that to mean that something was referencing the server by localhost IP. It uses the file: /etc/zabbix/zabbix_agentd.conf for that function, and all of the srver IP's in that file show 127.0.0.1, which seemed odd to me. Shouldn't it have the public IP in there somewhere?
Just my thoughts... -
@art_of_shred said in need help with Zabbix server:
/var/log/zabbix_agentd.log
It said 127.0.0.1 was refusing connection. I took that to mean that something was referencing the server by localhost IP. It uses the file: /etc/zabbix/zabbix_agentd.conf for that function, and all of the srver IP's in that file show 127.0.0.1, which seemed odd to me. Shouldn't it have the public IP in there somewhere?
Just my thoughts...From the little research I've done this looks like it could be related to SELinux. Try the following command.
sudo setsebool httpd_can_connect_zabbix 1
-
from the /var/log/zabbix/zabbix_server.log file:
] Access denied for user 'zabbix'@'xx.xx.14.212' (using password: YES)
1141:20161020:143621.388 cannot set MySQL character set to "utf8"
1141:20161020:143621.388 database is down: reconnecting in 10 seconds -
@Mike-Davis said in need help with Zabbix server:
from the /var/log/zabbix/zabbix_server.log file:
] Access denied for user 'zabbix'@'xx.xx.14.212' (using password: YES)
1141:20161020:143621.388 cannot set MySQL character set to "utf8"
1141:20161020:143621.388 database is down: reconnecting in 10 secondsAh, you need to grant either 'zabbix'@* or 'zabbix'@'xx.xx.14.212 permission to the mysql database.
GRANT ALL TO 'zabbix'@'xx.xx.14.212' IDENTIFIED BY 'yourpassword';
Or something similar to that.
-
when I run:
sudo getenforce
it returns:
DisabledDo I need to enable it so those rules apply?
The guide I was following said to run these commands:
sudo setsebool -P httpd_can_network_connect=1
sudo setsebool -P httpd_can_connect_zabbix=1
sudo setsebool -P zabbix_can_network=1 -
Sorry been away in meetings recently...
@coliver is right about the GRANT command...
Is your mysql server on the same server as Zabbix or on a different one?
-
@Mike-Davis said in need help with Zabbix server:
when I run:
sudo getenforce
it returns:
DisabledDo I need to enable it so those rules apply?
The guide I was following said to run these commands:
sudo setsebool -P httpd_can_network_connect=1
sudo setsebool -P httpd_can_connect_zabbix=1
sudo setsebool -P zabbix_can_network=1If SELinux id disabled, then those commands won't have any affect until you enable it again.
-
database on the same server. If I log in to the database, and run:
select user, host from mysql.user;
it returns:
MariaDB [(none)]> select user, host from mysql.user;
+--------+--------------------+
| user | host |
+--------+--------------------+
| zabbix | % |
| root | 127.0.0.1 |
| root | ::1 |
| root | localhost |
| zabbix | localhost |
| zabbix | xx.xx.14.212 |
+--------+--------------------+
6 rows in set (0.00 sec) -
@Mike-Davis said in need help with Zabbix server:
database on the same server. If I log in to the database, and run:
select user, host from mysql.user;
it returns:
MariaDB [(none)]> select user, host from mysql.user;
+--------+--------------------+
| user | host |
+--------+--------------------+
| zabbix | % |
| root | 127.0.0.1 |
| root | ::1 |
| root | localhost |
| zabbix | localhost |
| zabbix | xx.xx.14.212 |
+--------+--------------------+
6 rows in set (0.00 sec)The user may exist but it may not have the granted permissions. You can run:
SHOW GRANTS FOR 'zabbix'@'xx.xx.14.212';
To see what that user has access to.
-
I think we have a bingo.
ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212'
-
Shouldn't this work:
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@xx.xx.14.212 IDENTIFIED BY 'mySecurePasswordHere';
-
@Mike-Davis said in need help with Zabbix server:
Shouldn't this work:
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@xx.xx.14.212 IDENTIFIED BY 'mySecurePasswordHere';
If the user already exists drop the IDENTIFIED BY part. But yes the syntax should work. Don't forget the single quotes around the username and IP address.
-
When I run it, I get:
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> show grants for [email protected]; ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212'
Do the single quotes matter when running these commands?
-
MariaDB [(none)]> show grants for [email protected];
ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212'
MariaDB [(none)]> show grants for zabbix
-> ;
+-------------------------------------------------------------------------------------------------------+
| Grants for zabbix@% |
+-------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON . TO 'zabbix'@'%' IDENTIFIED BY PASSWORD 'F7B59hashhereC9667D7D09DC' |
| GRANT ALL PRIVILEGES ONzabbix
. TO 'zabbix'@'%' |
+-------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)Do I have too many zabbix users configured? Should I just have the one with the external host IP?
-
@Mike-Davis said in need help with Zabbix server:
MariaDB [(none)]> show grants for [email protected];
ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212'
MariaDB [(none)]> show grants for zabbix
-> ;
+-------------------------------------------------------------------------------------------------------+
| Grants for zabbix@% |
+-------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON . TO 'zabbix'@'%' IDENTIFIED BY PASSWORD 'F7B59hashhereC9667D7D09DC' |
| GRANT ALL PRIVILEGES ONzabbix
. TO 'zabbix'@'%' |
+-------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)Do I have too many zabbix users configured? Should I just have the one with the external host IP?
I'm not sure, I don't think so I thought '%' was equivalent to local host.
-
@coliver said in need help with Zabbix server:
@Mike-Davis said in need help with Zabbix server:
MariaDB [(none)]> show grants for [email protected];
ERROR 1141 (42000): There is no such grant defined for user 'zabbix' on host 'xx.xx.14.212'
MariaDB [(none)]> show grants for zabbix
-> ;
+-------------------------------------------------------------------------------------------------------+
| Grants for zabbix@% |
+-------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON . TO 'zabbix'@'%' IDENTIFIED BY PASSWORD 'F7B59hashhereC9667D7D09DC' |
| GRANT ALL PRIVILEGES ONzabbix
. TO 'zabbix'@'%' |
+-------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)Do I have too many zabbix users configured? Should I just have the one with the external host IP?
I'm not sure, I don't think so I thought '%' was equivalent to local host.
% is everything, like * would be in other places.
-
@coliver I think % is the wildcard from what I read. Not good practice, but I was trying to get it working.
-
@Mike-Davis said in need help with Zabbix server:
@coliver I think % is the wildcard from what I read. Not good practice, but I was trying to get it working.
Ah, that makes sense. So that should work.
-
You can also attempt to log in from the CLI from the Zabbix server...
mysql -u zabbix -p -h ip.add.14.212
And see if it lets you connect.
-
sudo mysql -u zabbix -p -h xx.xx.14.212
Enter password:
ERROR 2005 (HY000): Unknown MySQL server host 'xx.xx.14.212' (0)