mysqlstat−setup − sets up mysqlstat Net−SNMP module


mysqlstat-setup [−f] [−u USER ] [−p PASSWORD ] [−C CONFDIR ] [−L LIBDIR ] [−−defaults−file= FILE ] [−−force] [−−host= HOST ] [−−user= USER ] [−−password= PASSWORD ] [−−snmp−user= USER ] [−−snmp−password= PASSWORD ] [−−snmp−host= HOSTNAME ] [−−confdir CONFDIR ] [−−libdir LIBDIR ]

mysqlstat-setup [−h] [−−help] [−−usage]


This utility configures snmpd(8) and mysqld(8) servers for using the mysqlstat(8) module. It performs the following actions:
1. Creates MySQL user and grants it the necessary privileges.

By default the user snmp is created with empty password. This can be controlled using the following command line options:

Sets the MySQL user name to use.

−−snmp−password= PASSWORD

Sets the MySQL password.

−−snmp−host= HOSTNAME

Sets the source host name or IP address to use. Default is localhost.

Credentials for connecting the MySQL server are read from file ~/.my.cnf, if such file exists. Another file may be given using the −−defaults−file option. Credentials can also be given from command line, using the options −−user, −−password and −−host, although such usage is not recommended for security reasons.

2. Creates the /etc/snmp/mysqlstat.cnf file.

This file defines the MySQL credentials to use when connecting to the mysqld server. If that file already exists, mysqlstat-setup assumes the module has already been configured and refuses to run (unless given the −−force option).

3. Edits the /etc/snmp/snmpd.conf file.

The dlmod statement is inserted, which instructs snmpd to load the module.


In most cases, it suffices to run the utility without any special options. Nevertheless, the following options are provided that alter its behavior:
, −−force

Force operation even if it is detected that the mysqlstat module has already been set up.

−u, −−user= USER

Connect to MySQL using USER as user name. This user must have GRANT privileges.

Note: it is not the user that will be used by the mysqlstat module. For that, see −−snmp−user, below.

−p, −−password= PASSWORD

Connect to MySQL using the supplied password.

Note: it is not the password that the mysqlstat module will be using. For that, see −−snmp−password, below.

−−host= HOST

Connect to MySQL server running at HOST (hostname or IP address). This will also be stored in /etc/snmp/mysqlstat.cnf for use by the mysqlstat module.

−−defaults−file= FILE

Read MySQL access credentials from FILE . By default ~/.my.cnf is read if it exists. This way of supplying access credentials is preferred over the command line options.

−−snmp−user= USER

MySQL user to be used by the mysqlstat module. Default is snmp.

−−snmp−password= PASSWORD

MySQL password to be used by the mysqlstat module. Default is empty password.

−−snmp−host= HOSTNAME

Hostname or IP address the mysqlstat module will connect from. This is used when granting MySQL user privileges.

−C, −−confdir= DIR

Assume DIR instead of /etc/snmp.

−L, −−libdir= LIBDIR

Net-snmp modules are installed to LIBDIR .

The following options provide informational output:


Print short help summary.


Print the manpage.


Show a terse command line usage summary.



Manpage server at

Powered by mansrv 1.0