Installation
- Open the pkg inside the modules directory of a nagios 3.x
- Edit opdb.c and set up these 3 lines
/* This file has the mysql database host, user and password, a example file is supplied */
#define DBCONF "/usr/local/nagios/etc/db.php"
/* In case the broker can't write to the database, it writes the queries to a file, so
they can be importer later on, both for opmon statiscts and performance database
*/
#define FAILED_QUERIES_FILE "/usr/local/nagios/var/opmon.sql"
#define PERF_FAILED_QUERIES_FILE "/usr/local/nagios/var/opperf.sql"
- In the directory modules run to compile it:
gcc -D_GNU_SOURCE -Wall -shared -o opdb.o opdb.c -L/usr/lib/mysql -lmysqlclient -DNSCORE
- Copy it to your nagios directory
- create the mysql databases with the supplied script opmon-mysql.sql
Ex. mysql -p -f < opmon-mysql.sql
- in opcfg, go to Main Config, Event Broker and add it there
- Export the configuration and you should see it writing to the databases