Ohne Open-Source gäbe es die ADMIN-BOX nicht in der Form. Daher wollen wir uns bei der Open-Source Community, und insbesondere der
Nagios/Icinga Community, herzlich bedanken! Deswegen stellen wir an dieser Stelle ein paar unserer selbst entwickelten Scripte und
Plugins zum Download bereit, um auf diesem Wege unser Wissen und die gesammelte Erfahrung der Community zurückzugeben.
Alle Scripte ohne jegliche Gewährleistung oder Garantie, unter den Bedingungen der GNU Lizenz.
Scripte/Plugins zum Download:
check_find_file_age.sh
Es handelt sich bei diesem Script um ein simples wrapper-tool um die Ausgabe des find Befehls an Nagios-ähnliche
Monitoring-Systeme zu übergeben. Es wird verwendet um zu überprüfen ob Dateien/Ordner mit einem bestimmten Namen, Typ und Alter
vorhanden sind.
Generell kann man mit Hilfe dieses Scriptes alles prüfen was man mit einem find Aufruf finden und filtern kann.
Kreativität und Anwendungsmöglichkeiten sind dabei kaum Grenzen gesetzt. Siehe auch Hilfe und manpage zu find.
*********************************
check_find_file_age
*********************************
Script for using "find" command and generate nagios-compatible output
Usage: check_find_file_age.sh -f {folder} -w {warn} -c {crit}
arguments:
-f --folder {search-folder}
-w --warn {warning} age in minutes
-c --crit {critical} age in minutes
optional arguments:
--maxage find -mmin -{warn/crit} (default)
--minage find -mmin +{warn/crit}
--ignore ignore all results younger/older this value
Note: used to exclude false positives, for example
if you got very old files in the check folder you want to ignore
example: warn and crit in minutes
1 day = 1440
7 days = 10080
optional arguments:
Note: these arguments will be passed to find command, and use the same syntax
-n --name {filename} regex for find
-t --type set -type for find, like "d" (directories only)
-maxdepth set maxdepth for find (default: 1)
-arg --arg any other arguments, see "man find"
example: -arg "-size 0c"
--exit_file_found exit_code for Script if file was found (default:0)
--exit_file_not_found exit_code for Script if file was not found (default:2)
Note: exit_codes have to be one of: 0 1 2
optional arguments:
--okstring optional String to add to output for OK state
--notokstring optional String to add to output for not-OK state
Note: mask the strings in " "
-h --help shows this help message
-V --version prints version and release info
Nagios compatible exit codes: 0=OK;1=WARN;2=CRIT;3=UNKNOWN
This plugin generates no perfdata.
***********************************************************************
Thank you for using this script!
For more infos on our services please visit www.admin-box.de
Ein simples kleines Script, um im Monitoring-Dashboard auf einen Blick zu sehen ob ein Server rebootet werden muss.
Quellcode:
#!/bin/bash
#
# check if system needs reboot
#
if [ -f /var/run/reboot-required ]; then
output=$(cat /var/run/reboot-required)
# if file exists but is empty, add output string
if [ -z "${output}" ]; then output="*** Neustart des Systems erforderlich ***"; fi
echo "${output}"
exit 1
else
echo "OK - no file \"/var/run/reboot-required\" found"
exit 0
fi
check_whisper_aggregation.sh
Script um die Aggregation einer whisper Datenbank zu überprüfen und bei Bedarf zu korrigieren.
Ein praktisches Tool für alle, die perfdata in einer whisper Datenbank speichern.
*********************************
*** Check Whisper Aggregation ***
*********************************
Usage: check_whisper_aggregation.sh (--resize)
OPTIONAL:
--resize do whisper-resize for every found match
(default: no resize)
Nagios compatible exit_levels: 0=OK;1=WARN;2=CRIT;3=UNKNOWN
This script generates perfdata by default:
hosts_total metrics_total avg_number_metrics max_number_metrics metrics_error
**************************************************************
Thank you for using this script!
For more infos on our services please visit www.admin-box.de
*********************************
anonymize_log_ip
*********************************
Script for anonymizing IPs in logfiles
Usage: anonymize_log_ip.sh -f {logfile} -age {days} (-e {exclude})
arguments:
-f --file {logfile}
(default: /var/log/apache2/*.log*)
-age {days} to keep IPs in logfiles
(default: 7)
Note: set to 0 to disable age check
optional arguments:
-e {string} exclude one or more strings from search
Note: use -e before each string
-h --help shows this help message
-V --version prints version and release info
--debug verbose debug infos on console
***********************************************************************
Thank you for using this script!
For more infos on our services please visit www.admin-box.de
Script um VM Snapsots auf einem ESXi zurückzusetzen.
*********************************
revert_snapshots
*********************************
Script for reverting VM Snapshots on a ESXi
it will always revert the machine to the last(youngest) made Snapshot
Usage: revert_snapshot.sh -n [VM_name]
-n [VM_name] name of virtual machines to grep (regex)
for example: W10 will find all machines matching W10*
Optional command-line parameters:
--version prints version and release info
--debug show verbose debug output
Note: This Script is meant to be run on the ESXi Server locally.
Set it up on a datastore accessible to the ESXi
and then run it remote by ssh or locally by cron.
Tested on ESXi 5.5 and ESXi 6.0
**********************************************************************************************
Thank you for using this script! For more infos on our services please visit www.admin-box.de