Fix NRPE Problem with Mariadb 10.2

francis

Administrator
Staff member
Problem:

Bash:
check_mysql.c:61: error: ‘MYSQL_PORT’ undeclared here (not in a function)
make[1]: *** [check_mysql-check_mysql.o] Error 1
make[1]: Leaving directory `/xxxxx/linux-nrpe-agent/subcomponents/nagiosplugins/nagios-plugins-2.2.1/plugins'
make: *** [install-recursive] Error 1
Solution:

Bash:
wget wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
tar -zxvvf linux-nrpe-agent.tar.gz
 
cd linux-nrpe-agent/subcomponents/nagiosplugins/
tar -zxvvf nagios-plugins-2.2.1.tar.gz
 
cd nagios-plugins-2.2.1/plugins/
 
sed -i "38i\#define MYSQL_PORT 3306" check_mysql.c
 
sed -i "32i\#define MYSQL_PORT 3306" check_mysql_query.c
 
# It is necessary to repack the folder because the fullinstall will always decompress nagios-plugins-2.2.1.tar.gz
cd ../../
rm nagios-plugins-2.2.1.tar.gz
tar -zcvf nagios-plugins-2.2.1.tar.gz nagios-plugins-2.2.1
cd ../../
./fullinstall
 
Top