Re: [Nagios-devel] Config from PostgreSQL
Posted: Tue Dec 07, 2010 8:31 pm
--YiEDa0DAkWCtVeE4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Mon, Dec 06, 2010 at 10:41:39PM +0000, Phil Sturgeon said:
> I've been charged with a mission a little outside of my usual
> skillset, and that is to get Nagios 3.2.3 running from config based
> on a PostgreSQL table instead of the normal cnf_dir setting. I can
> work out the actual code for this but im struggling to find /where/
> it should go.
>=20
> I have only found one instance of cnf_dir in the source and that is here:
>=20
> else if(strstr(input,"cfg_file=3D")=3D=3Dinput ||
> strstr(input,"cfg_dir=3D")=3D=3Dinput)
> continue;
>=20
> in config.c line 1328. I have no problems hacking the core, but
> where do I start?
I'd strongly suggest that you write code in some high level language to
pull it from the database and write config files for nagios. I've used
this approach in the past with a fair amount of success. It has the
benefit of being much simpler, both to maintain and to upgrade.
If you absolutely must pull it live from the database, you'll want to
look at some of the existing broker modules for how to hook into the
core and all that sort of thing, but I really don't envy you the task -
you'll need to learn the psql API, the nagios event broker API, write
all sorts of fairly hairy code to cast one set to another set, and
finally get working callbacks to get nagios to reload for every update
to the database.
Good luck,
--=20
--------------------------------------------------------------------------
| Stephen Gran | purpitation, n.: To take something off |
| [email protected] | the grocery shelf, decide you don't |
| http://www.lobefin.net/~steve | want it, and then put it in another |
| | section. -- "Sniglets", Rich Hall & |
| | Friends |
--------------------------------------------------------------------------
--YiEDa0DAkWCtVeE4
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQIcBAEBCAAGBQJM/pWWAAoJELMRjO+K6o/uVZQQAISEQMipXVVuFLORFh5jbENc
xkMpafkvDijCuXNkZ5WFgiUGbyY8vWFOCrWqCbF22bU7gb1pj9vWomKU0bI7yC6s
6CvZ4Rq2cwbTE1jLO7CQvxGC3VcuGkv8g8vO2lQAozJCn3HFNHZZicrWbYms5g7X
8MSKi6LptFGaWXGSNxtpR/2Ge8gwiZEOCu+6Z76EamwY7t3F+dxmypwLjDWa+9ZO
pI08BHykU30fQN2pTnwFFvDLDkOn1fNueApCL8EeG7Zzf5ESQ8PGcFVczTphPywZ
rtz5/EwzuqS22h9YpyqoM7TbVX/aeUjkwf0rnVs4bLpc9Syyinx2s4O8dhqmrVug
vIMqcJZ+kuL0ZLmMlazALdGiE0TB9YTOg8GfMW3s30Prh028f1PSd3SLJmHqpmyy
cL7L/pY7RAXpNlLtSqDXfbPFmkD9EGX3qyD7imuHRNLpZc+G0JfaeF68F7zFTkJ1
qyAV/xhrP7JVgrpahf1HXeE8Lm+F1M5KT5Q+Jt845b8LW4XGbEc5qDGXKGCV/RAZ
RZPGtu9njcjrqhik36OdQQlQzAJ/fp4MbRVO6BxjfLibQ3H5sja5xdtGWNz2HEVV
+vRRX6XAwqaTzSaXIOF6RilCXbHA7frBl99jRNd0mPQ2VFsqA13nfy2udKt3bOnS
Iji382rA+5ZzbB1Ydc55
=6Ru0
-----END PGP SIGNATURE-----
--YiEDa0DAkWCtVeE4--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]