Skip to content

Commit d1431da

Browse files
author
Brice Figureau
committed
Support getting MySQL config settings from a config file
Various perl clean-ups Signed-off-by: Brice Figureau <[email protected]>
1 parent 7d71b6c commit d1431da

File tree

5 files changed

+133
-184
lines changed

5 files changed

+133
-184
lines changed

README

+16-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (c) 2008,2009 Brice Figureau <[email protected]>
44
PREAMBLE
55
========
66

7-
Mysql-snmp is a MySQL Net-SNMP agent written in Perl, and using the Net-Snmp
7+
mysql-agent is a MySQL Net-SNMP agent written in Perl, and using the Net-Snmp
88
Perl bindings.
99

1010
It connects to a mysql server and returns information to Net-SNMP when needed.
@@ -64,15 +64,26 @@ Configure mysql-snmp
6464
Under debian, the daemon can be configured with /etc/default/mysql-snmp.
6565
On all platform, the configuration is done with command line arguments:
6666

67-
-u DBUSER use DBUSER as user to connect to mysql
68-
-p DBPASS use DBPASS as password to connect to mysql
69-
-h|--host HOST connect to mysql HOST
70-
-P|--port PORT port to connect to (default 3306)
67+
-h|--host HOST connect to mysql HOST
68+
-P|--port PORT port to connect to (default 3306)
69+
-u|--user DBUSER use DBUSER as user to connect to mysql
70+
-p|--passwordi DBPASS use DBPASS as password to connect to mysql
71+
-c|--config FILE read MySQL configuration from FILE
72+
7173
-m|--master check master
7274
-s|--slave check slave
7375
--oid OID registering OID
7476
-i|--refresh refresh interval in seconds
7577

78+
You can specify the mysql connection parameters in a config file using my.cnf format, like this:
79+
For example:
80+
81+
[client]
82+
host=dbserver
83+
port=3306
84+
user=monitor
85+
password=secret
86+
7687

7788
OPENNMS
7889
=======

debian/manpage.1

-88
This file was deleted.

my.cnf

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[client]
2+
host=localhost
3+
#port=3306
4+
user=monitor
5+
password=secret

0 commit comments

Comments
 (0)