Code

nagixsc.git
14 years agoReorder daemonizing (creation of PID file)
Sven Velt [Thu, 17 Jun 2010 12:51:31 +0000 (14:51 +0200)]
Reorder daemonizing (creation of PID file)

If the pipe is NOT writeable you should see an error message instead of
just a not running daemon.

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoNew init.d scripts for all distribution
Sven Velt [Thu, 17 Jun 2010 12:50:00 +0000 (14:50 +0200)]
New init.d scripts for all distribution

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoAdded README with URLs to repo
Sven Velt [Wed, 9 Jun 2010 13:30:44 +0000 (15:30 +0200)]
Added README with URLs to repo

Signed-off-by: Sven Velt <sven@velt.de>
14 years agocheck for writable checkresult directory
Joerg Linge [Thu, 3 Jun 2010 16:47:37 +0000 (00:47 +0800)]
check for writable checkresult directory

14 years agoPimp xml2cfg with code from xml2nagios
Sven Velt [Thu, 3 Jun 2010 15:18:24 +0000 (17:18 +0200)]
Pimp xml2cfg with code from xml2nagios

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoAdd function to merge multiple XML files
Sven Velt [Thu, 3 Jun 2010 12:38:09 +0000 (14:38 +0200)]
Add function to merge multiple XML files

Signed-off-by: Sven Velt <sven@velt.de>
14 years ago2nd try: Dots are a security hole in file names
Sven Velt [Thu, 27 May 2010 13:29:29 +0000 (15:29 +0200)]
2nd try: Dots are a security hole in file names

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoDots are a security hole in filenames
Sven Velt [Tue, 25 May 2010 14:02:50 +0000 (16:02 +0200)]
Dots are a security hole in filenames

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoFix "active" mode to check if only 1 result in XML
Sven Velt [Fri, 26 Mar 2010 14:27:45 +0000 (15:27 +0100)]
Fix "active" mode to check if only 1 result in XML

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoFilter out host check if -D specified
Sven Velt [Tue, 23 Mar 2010 16:40:38 +0000 (17:40 +0100)]
Filter out host check if -D specified

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoDisable SSL in sample-configs/*.cfg
Sven Velt [Tue, 23 Mar 2010 16:23:07 +0000 (17:23 +0100)]
Disable SSL in sample-configs/*.cfg

Could be confusing because of not existing cert/key file.

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoAdded check if command line is empty
Sven Velt [Fri, 5 Mar 2010 12:06:52 +0000 (13:06 +0100)]
Added check if command line is empty

An empty command line entry in conf file did raise an error within
subprocess call. Now an unknow check result is returned.

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoHTTP-Server can now daemonize
Sven Velt [Thu, 4 Mar 2010 13:58:01 +0000 (14:58 +0100)]
HTTP-Server can now daemonize

Added daemonize() to nagixsc and "-d" or "--daemon" to conf2http and
http2nagios.

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoRename scripts and python module
Sven Velt [Thu, 4 Mar 2010 09:18:02 +0000 (10:18 +0100)]
Rename scripts and python module

Put nagixsc.py into nagixsc/__init__.py to use and install it as an usul
Python module.

Renamed dummy_* to more "offical" names.

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoSmall fix if run in "checkresult" mode
Sven Velt [Tue, 23 Feb 2010 15:10:27 +0000 (16:10 +0100)]
Small fix if run in "checkresult" mode

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoAdded --nossl to HTTP daemons
Sven Velt [Thu, 18 Feb 2010 12:08:43 +0000 (13:08 +0100)]
Added --nossl to HTTP daemons

Disable SSL on command line even if it's activated in cfg file.

Signed-off-by: Sven Velt <sven@velt.de>
14 years agoconf2xml: Added HTTP POST support
Sven Velt [Wed, 17 Feb 2010 15:51:00 +0000 (16:51 +0100)]
conf2xml: Added HTTP POST support

It's not longer necessary to create and XML file, save it and
HTTP(S)-POST it with curl. Just use a URL as output file, add -l/-a if
login is required and be happy :)

14 years agoSmall syntax fix
Sven Velt [Wed, 17 Feb 2010 15:50:34 +0000 (16:50 +0100)]
Small syntax fix

14 years agoFix filename
Sven Velt [Tue, 9 Feb 2010 22:17:33 +0000 (23:17 +0100)]
Fix filename

14 years agoRework http2nagios (and xml2nagios) and add SSL
Sven Velt [Tue, 9 Feb 2010 22:13:03 +0000 (23:13 +0100)]
Rework http2nagios (and xml2nagios) and add SSL

"nagixsc_http2nagios.py" does not call "nagixsc_xml2nagios.py" as a subprocess
anymore.

Instead there are 2 function "dict2out_passive" for passive checks and
"dict2out_checkresult" for check result creation.

And... nagixsc_http2nagios now also supports SSL so noone has to send
his authentication data unencrypted over the network :)

14 years agoconf2http can now use SSL!
Sven Velt [Tue, 9 Feb 2010 14:03:05 +0000 (15:03 +0100)]
conf2http can now use SSL!

Have a look at the conf2http.cfg! It *needs* two more options, "ssl" and
"sslcert". To be sure use a *FULL* pathname to key/cert file.

Create a key and self-signed certificate with:

% openssl req -x509 -nodes -days 365 -newkey rsa:1024 \
          -keyout server.pem -out server.pem

14 years agoEnhance conf2http (and conf2xml)
Sven Velt [Wed, 13 Jan 2010 23:20:00 +0000 (00:20 +0100)]
Enhance conf2http (and conf2xml)

"nagixsc_conf2http.py" does not call "nagixsc_conf2xml.py" as a
subprocess anymore.

Instead "conf2dict()" is now a function in "nagixsc.py" and can be
called without fork()/exec().

14 years agoMove encoding check to "nagixsc.py"
Sven Velt [Wed, 13 Jan 2010 22:09:55 +0000 (23:09 +0100)]
Move encoding check to "nagixsc.py"

14 years agoMove "exec_check" to nagixsc.py
Sven Velt [Wed, 13 Jan 2010 21:55:15 +0000 (22:55 +0100)]
Move "exec_check" to nagixsc.py

14 years agoAllow command lines with quotes
Sven Velt [Fri, 8 Jan 2010 13:48:12 +0000 (14:48 +0100)]
Allow command lines with quotes

Until now command lines where split at spaces (" ") but if you want some
string arguments including spaces ("-e '220 mail.server.de'") this
doesn't work anymore. So now we use "shlex.split()" for this.

14 years agoAdded check to reset future timestamps
Sven Velt [Tue, 5 Jan 2010 14:03:54 +0000 (15:03 +0100)]
Added check to reset future timestamps

14 years agoOutput service only if description is set
Sven Velt [Fri, 18 Dec 2009 14:50:07 +0000 (15:50 +0100)]
Output service only if description is set

14 years agoConfig files and cmd line options for daemons
Sven Velt [Thu, 17 Dec 2009 23:59:30 +0000 (00:59 +0100)]
Config files and cmd line options for daemons

Moved config files from examples/ to sample-configs/conf/, new config
files for daemons in sample-configs/

Changed path names in QUICKSTART.de.txt

14 years agoImport md5 from hashlib/md5, dep. on Py version
Sven Velt [Wed, 16 Dec 2009 16:35:45 +0000 (17:35 +0100)]
Import md5 from hashlib/md5, dep. on Py version

2.4: Only "md5" available
2.5: "md5" and "hashlib" work
2.6: Only "hashlib"

So try to "from hashlib import md5" and if it doesn't work just do a
"from md5 import md5" and just use "md5(___).hexdigest()" in the code.

14 years agoAgain still PoC, but reworked w/o CherryPy
Sven Velt [Mon, 14 Dec 2009 23:38:16 +0000 (00:38 +0100)]
Again still PoC, but reworked w/o CherryPy

14 years agoStill PoC, but reworked w/o CherryPy
Sven Velt [Mon, 14 Dec 2009 23:07:43 +0000 (00:07 +0100)]
Still PoC, but reworked w/o CherryPy

14 years agoFix "file -1 seconds old" bug
Sven Velt [Mon, 14 Dec 2009 23:11:40 +0000 (00:11 +0100)]
Fix "file -1 seconds old" bug

14 years agoWIP: PoC of "http2nagios" / rename "cgi"->"http"
Sven Velt [Fri, 11 Dec 2009 11:58:29 +0000 (12:58 +0100)]
WIP: PoC of "http2nagios" / rename "cgi"->"http"

14 years agoWIP: PoC of conf2cgi/Nag(ix)RPE \o/
Sven Velt [Tue, 8 Dec 2009 22:45:19 +0000 (23:45 +0100)]
WIP: PoC of conf2cgi/Nag(ix)RPE  \o/

14 years agoFilter option build into nagixsc_conf2xml (-H/-D)
Sven Velt [Tue, 8 Dec 2009 21:57:12 +0000 (22:57 +0100)]
Filter option build into nagixsc_conf2xml (-H/-D)

14 years agoAllow HTTP username and password (-l/-a)
Sven Velt [Tue, 8 Dec 2009 13:26:58 +0000 (14:26 +0100)]
Allow HTTP username and password (-l/-a)

14 years agoAdded host checks
Sven Velt [Tue, 8 Dec 2009 11:06:13 +0000 (12:06 +0100)]
Added host checks

15 years agoTypo in QUICKSTART.de.txt, thx to Sven Jeck
Sven Velt [Fri, 4 Dec 2009 08:47:50 +0000 (09:47 +0100)]
Typo in QUICKSTART.de.txt, thx to Sven Jeck

15 years agoWIP: Generate minimal, hardcoded Nagios cfg from XML
Sven Velt [Mon, 30 Nov 2009 10:53:31 +0000 (11:53 +0100)]
WIP: Generate minimal, hardcoded Nagios cfg from XML

15 years agoInitial commit
Sven Velt [Sun, 29 Nov 2009 19:26:08 +0000 (20:26 +0100)]
Initial commit