New function write_xml
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Added livestatus as data source
... to conf2http (try "_livestatus" as config file name after putting
path/ip&port into conf2http.cfg)
... new command live2xml
and be a little bit more verbose in the config file of conf2http
Signed-off-by: Sven Velt <sven@velt.de>
... to conf2http (try "_livestatus" as config file name after putting
path/ip&port into conf2http.cfg)
... new command live2xml
and be a little bit more verbose in the config file of conf2http
Signed-off-by: Sven Velt <sven@velt.de>
Fixed port for http2nagios
and be a little bit more verbose in sample-configs/http2nagios.cfg
Signed-off-by: Sven Velt <sven@velt.de>
and be a little bit more verbose in sample-configs/http2nagios.cfg
Signed-off-by: Sven Velt <sven@velt.de>
Fix for config file reading
Fix for Python 2.5
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
xml2cfg: Read templates from files
Also select if it outputs hosts and/or services
Signed-off-by: Sven Velt <sven@velt.de>
Also select if it outputs hosts and/or services
Signed-off-by: Sven Velt <sven@velt.de>
Add timeout to plugin execution
It's now possible to terminate plugins after a few seconds. Just set
"plugin_timeout" and maybe "plugin_timeout_returncode" in "[nagixsc]"
section in the conf file. Sample config "timeout.conf" included in
"sample-configs/conf/".
Signed-off-by: Sven Velt <sven@velt.de>
It's now possible to terminate plugins after a few seconds. Just set
"plugin_timeout" and maybe "plugin_timeout_returncode" in "[nagixsc]"
section in the conf file. Sample config "timeout.conf" included in
"sample-configs/conf/".
Signed-off-by: Sven Velt <sven@velt.de>
Changed default file, add output mode
The XML file is now read from STDIN (before: "nagixsc.xml") and output
shows human readable format ONLY. If you want a python list/dict, set
"-P" ("pprint") option at commandline.
Signed-off-by: Sven Velt <sven@velt.de>
The XML file is now read from STDIN (before: "nagixsc.xml") and output
shows human readable format ONLY. If you want a python list/dict, set
"-P" ("pprint") option at commandline.
Signed-off-by: Sven Velt <sven@velt.de>
Added fork()ing to HTTP daemons
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Rebuild config file parsing, added defaults
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
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>
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>
New init.d scripts for all distribution
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Added README with URLs to repo
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
check for writable checkresult directory
Pimp xml2cfg with code from xml2nagios
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Add function to merge multiple XML files
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
2nd try: Dots are a security hole in file names
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Dots are a security hole in filenames
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Fix "active" mode to check if only 1 result in XML
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Filter out host check if -D specified
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
Disable SSL in sample-configs/*.cfg
Could be confusing because of not existing cert/key file.
Signed-off-by: Sven Velt <sven@velt.de>
Could be confusing because of not existing cert/key file.
Signed-off-by: Sven Velt <sven@velt.de>
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>
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>
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>
Added daemonize() to nagixsc and "-d" or "--daemon" to conf2http and
http2nagios.
Signed-off-by: Sven Velt <sven@velt.de>
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>
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>
Small fix if run in "checkresult" mode
Signed-off-by: Sven Velt <sven@velt.de>
Signed-off-by: Sven Velt <sven@velt.de>
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>
Disable SSL on command line even if it's activated in cfg file.
Signed-off-by: Sven Velt <sven@velt.de>
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 :)
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 :)
Small syntax fix
Fix filename
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 :)
"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 :)
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
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
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().
"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().
Move encoding check to "nagixsc.py"
Move "exec_check" to nagixsc.py
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.
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.
Added check to reset future timestamps
Output service only if description is set
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
Moved config files from examples/ to sample-configs/conf/, new config
files for daemons in sample-configs/
Changed path names in QUICKSTART.de.txt
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.
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.
Again still PoC, but reworked w/o CherryPy
Still PoC, but reworked w/o CherryPy
Fix "file -1 seconds old" bug
WIP: PoC of "http2nagios" / rename "cgi"->"http"
WIP: PoC of conf2cgi/Nag(ix)RPE \o/
Filter option build into nagixsc_conf2xml (-H/-D)
Allow HTTP username and password (-l/-a)
Added host checks
Typo in QUICKSTART.de.txt, thx to Sven Jeck
WIP: Generate minimal, hardcoded Nagios cfg from XML
Initial commit