[Nagios-devel] Patch: Sourcing Passive check results from a database

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] Patch: Sourcing Passive check results from a database

Post by Guest »

This is a multipart MIME message.

--==_Exmh_-2444528180
Content-Type: text/plain; charset=us-ascii


We have around 3000 passive checks going (all the data collection is
done by another program, eddie [www.eddie-tool.net], which runs on the
hosts being monitored) so we found it more reliable to have the passive
check results get put into a database, and only deleted from that
database when nagios had processed it.

We use mysql so I haven't been able to test it with postgres, but,
fingers crossed, it should work, maybe.

--
Dougal Scott Connect Internet Solutions
dwagon@connect.com.au 9/114 Albert Rd
Senior Systems Administrator South Melbourne, Australia, 3205


--==_Exmh_-2444528180
Content-Type: text/plain ; name="xpasv.h"; charset=us-ascii
Content-Description: xpasv.h
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xpasv.h"

/************************************************************************=
*****
*
* XPASV.H - Header file for database status data routines
*
* Copyright (c) 1999-2001 Ethan Galstad (nagios@nagios.org)
* Last Modified: 06-22-2001
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
************************************************************************=
*****/

#define XPASV_PASSIVECHECKS_TABLE "passive_checks"

#define XPASV_BUFFER_LENGTH 1024
#define XPASV_SQL_LENGTH 2048 /* buffer length for SQL queries */

int xpasv_check_connection(void);
int xpasv_reconnect(void);
int xpasv_begin_transaction(void);
int xpasv_commit_transaction(void);
int xpasv_rollback_transaction(void);
int xpasv_optimize_tables(void);
int get_passive_checks_from_database(void);
int xpasv_escape_string(char *,char *);

int xpasvdb_grab_config_info(char *);
void xpasvdb_grab_config_directives(char *);
int xpasvdb_initialize(char *);
int xpasvdb_connect(void);
int xpasvdb_disconnect(void);
int xpasvdb_query(char *);
int xpasvdb_free_query_memory(void);


--==_Exmh_-2444528180
Content-Type: text/plain ; name="xpasv.c"; charset=us-ascii
Content-Description: xpasv.c
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="xpasv.c"

/************************************************************************=
*****
*
* XPASV.C - Database routines for passive checks
*
* Copyright (c) 2000-2002 Ethan Galstad (nagios@nagios.org)
* Last Modified: 05-27-2002
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
************************************************************************=
*****/

/*********** COMMON HEADER FILES ***********/

#include "../common/config.h"
#include "../common/common.h"
#include "../common/locations.h"

#ifdef NSCORE
#include "../base/nagios.h"
#endif

#include "xpasv.h"

/**** IMPLEMENTATION SPECIFIC HEADER FILES ****/

#ifdef US

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: dwagon@connect.com.au
Locked