Database support
tvilliers
tvilliers at lastminute.com
Mon Nov 10 15:37:48 CET 2003
On Fri, 07 Nov 2003 09:52:00 -0700, jason wrote:
>
> ----- Original Message -----
> From: Tory Skyers
> To: nagios-users at lists.sourceforge.net Sent: Friday, November 07, 2003
> 8:15 AM Subject: [Nagios-users] Database support
>
>
> How Many people are actually using database support? I'm running into an
> issue where nagios is not writing its information to the database and it's
> not writing it to text files, and I'm wondering if the database support is
> worth the trouble. The service binds up and locks the machine. I can't
> seem to find any real help on the syntax in the config files to tell it to
> write to the database instead of the text files. I have configured the
> lines in the cgi.cfg but what do I tell nagios.cfg to read and write to
> the database? It would be nice to have so I can build my own reporting
> engine to mine the data from a database rather than text files.
>
> Tory Skyers
> Network Administrator
> Prudential Fox & Roach
> 610-993-1327
> tskyers at foxroach.com
>
>
> If you are using a single host add all the switches while running
> configure: (make sure to do a 'make clean')
>
> mysql info follows...
>
for postgresql:
cd $SRC/nagios-1.1
vi xdddb.c, xsddb.c, xcddb.c, xrddb.c
ensure this:
#ifdef USE_XDDPGSQL
#include <libpq-fe.h>
#endif
./configure --prefix=$BASE/nagios \
--with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios \
--with-nagios-user=$USER --with-nagios-grp=$GROUP \
--with-command-user=$USER --with-command-grp=$GROUP \
--with-init-dir=$BASE/bin/ \
--with-lockfile=$BASE/nagios/var/nagios.lock \
--with-template-objects --with-template-extinfo \
--enable-embedded-perl --with-pgsql-xdata \
--with-gd-lib=$BASE/lib --with-gd-inc=$BASE/include \
--with-pgsql-lib=$BASE/lib --with-pgsql-inc=$BASE/include
and in $BASE/nagios/etc/cgi.cfg:
# DOWNTIME DATA
xdddb_host=hostname
xdddb_port=5432
xdddb_database=dbname
xdddb_username=uname
xdddb_password=passwd
#
# COMMENT DATA
xcddb_host=hostname
xcddb_port=5432
xcddb_database=dbname
xcddb_username=uname
xcddb_password=passwd
#
# STATUS DATA
xsddb_host=hostname
xsddb_port=5432
xsddb_database=dbname
xsddb_username=uname
xsddb_password=passwd
#
# EXTENDED DATA
xeddb_host=hostname
xeddb_port=5432
xeddb_database=dbname
xeddb_username=uname
xeddb_password=passwd
and in $BASE/nagios/etc/resource.cfg
# DB DOWNTIME DATA : 'hostdowntime' and 'servicedowntime'
xdddb_host=hostname
xdddb_port=5432
xdddb_database=dbname
xdddb_username=uname
xdddb_password=passwd
xdddb_optimize_data=1
# DB COMMENT DATA : 'hostcomments' and 'servicecomments'
xcddb_host=hostname
xcddb_port=5432
xcddb_database=dbname
xcddb_username=uname
xcddb_password=passwd
xcddb_optimize_data=1
# DB STATUS DATA : 'programstatus', 'hoststatus', 'servicestatus'
xsddb_host=hostname
xsddb_port=5432
xsddb_database=dbname
xsddb_username=uname
xsddb_password=passwd
xsddb_optimize_data=1
xsddb_optimize_interval=3600
# DB RETENTION DATA : 'programretention', 'hostretention', 'serviceretention'
xrddb_host=hostname
xrddb_port=5432
xrddb_database=dbname
xrddb_username=uname
xrddb_password=passwd
xrddb_optimize_data=1
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list