New nagios.cron
parent
7527af17cf
commit
ad1306d80b
@ -0,0 +1,85 @@
|
||||
HOME="/home/nagios"
|
||||
PATH="/usr/local/monitoring/bin:/home/nagios/bin:/usr/local/perl/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/dell/srvadmin/bin"
|
||||
MAILTO="epm-list@Princeton.EDU"
|
||||
|
||||
|
||||
#*/5 * * * * (/bin/bash -l -c "/usr/bin/php /usr/local/cacti/poller.php") >/usr/local/monitoring/log/cacti-poller.log 2>&1
|
||||
*/5 * * * * (/bin/bash -l -c "/usr/bin/php /usr/local/cacti/poller.php") >/dev/null 2>&1
|
||||
# check moved the check_email_delivery
|
||||
##*/15 * * * * /bin/echo "Lists Test with checksum $(/bin/echo \"Lists Test on $(date)\" | /usr/bin/md5sum)" | /bin/mail -s "Lists tests with checksum $(/bin/echo \"Lists Test on $(date)\" | /usr/bin/md5sum)" gwmon@lists.princeton.edu
|
||||
|
||||
# Clean the groundwk mailbox every couple of days
|
||||
##00 00 * * 0,2,4,6 /usr/local/monitoring/princeton/bulk_email_delete -c /usr/local/monitoring/etc/bulk_email_delete.conf -u grndwk2 -h owa.princeton.edu:993 -s -m 100:400
|
||||
##20 00 * * 0,2,4,6 /usr/local/monitoring/princeton/bulk_email_delete -c /usr/local/monitoring/etc/bulk_email_delete.conf -u groundwk -h owa.princeton.edu:993 -s -m 100:400
|
||||
|
||||
# Apps database backup every day at 10pm
|
||||
0 22 * * * /usr/local/monitoring/princeton/db_backup >/usr/local/monitoring/backups/db_backup.log 2>&1
|
||||
# RRD backup at 11pm
|
||||
00 23 * * * /bin/tar cfP /usr/local/monitoring/backups/rrd_backup.tar /usr/local/monitoring/rrd >/dev/null
|
||||
|
||||
# Weekly host/service disabled notification report
|
||||
00 09 * * 3 /usr/local/monitoring/princeton/host_service_status.awk /usr/local/monitoring/var/naemon/status.dat | mail -s "Disabled host/service checks and notifications" chris@princeton.edu epm-list@princeton.edu
|
||||
|
||||
# Daily Dell Temp Report - requested cancelled
|
||||
#00 * * * * /usr/local/monitoring/princeton/dell_temp_report 2>&1 | mail -s "Dell Temperature Report" eisinv@princeton.edu
|
||||
|
||||
# Hourly Encoder Temp Report - requested cancelled
|
||||
#00 * * * * /usr/local/monitoring/princeton/dell_temp_report encoder01 encoder02 encoder03 | mail -s "encoder's Temperature Report" augustin@princeton.edu
|
||||
|
||||
# Nagios passive checks
|
||||
##10 11 * * * /usr/local/monitoring/nagios/libexec/check_nrpe_passive -h `sed -n '/define hostgroup/{N;/hostgroup_name[[:space:]]\+Windows Dev\/QA$/{N;N;s/.*members[[:space:]]\+//p}}' /usr/local/monitoring/var/naemon/objects.cache` -s nrpe_wintest_tsm_backups -c check_tsm_backups -m 5 2 5
|
||||
00 09 * * * /usr/local/monitoring/nagios/libexec/check_nrpe_passive -h `sed -n '/define hostgroup/{N;/hostgroup_name[[:space:]]\+\(CPanel Dev\/QA\|Linux Dev\/QA\)$/{N;N;s/.*members[[:space:]]\+//p}}' /usr/local/monitoring/var/naemon/objects.cache | tr '\n' ','` -s nrpe_unixtest_tsm_backups -c check_tsm_backups -m 10 2 5
|
||||
|
||||
##00 15 * * * /usr/local/monitoring/nagios/libexec/check_nrpe_passive -h `sed -n '/define hostgroup/{N;/hostgroup_name[[:space:]]\+Windows Prod$/{N;N;s/.*members[[:space:]]\+//p}}' /usr/local/monitoring/var/naemon/objects.cache | tr '\n' ','` -s nrpe_win_tsm_backups -c check_tsm_backups -m 10 2 5
|
||||
00 13 * * * /usr/local/monitoring/nagios/libexec/check_nrpe_passive -h `sed -n '/define hostgroup/{N;/hostgroup_name[[:space:]]\+\(CPanel Prod\|Linux Prod\)$/{N;N;s/.*members[[:space:]]\+//p}}' /usr/local/monitoring/var/naemon/objects.cache | tr '\n' ','` -s nrpe_unix_tsm_backups -c check_tsm_backups -m 20 2 5
|
||||
|
||||
# Dump hosts from Cacti
|
||||
00 12 * * * /usr/bin/php /usr/local/cacti/cli/add_tree.php --list-hosts > /usr/local/cacti/cac_hosts 2>/dev/null
|
||||
|
||||
# Add hosts to Nagios, Cacti, SIEM
|
||||
00 19 * * * . $HOME/.ssh/.ssh-agent >/dev/null 2>&1; /usr/local/monitoring/princeton/nagios_modify >> /usr/local/monitoring/log/nagios_modify.log 2>&1
|
||||
|
||||
# Reload Cacti Update script
|
||||
00 00 * * 1-6 /bin/kill -HUP `cat /var/run/cacti/cacti_update.pid`
|
||||
00 00 * * 0 /bin/kill -TERM `cat /var/run/cacti/cacti_update.pid`; sleep 300; cd /usr/local/monitoring/nagios/libexec/eventhandlers; ./cacti_update
|
||||
|
||||
# Dump host info from different Nagios groups into files and upload to a Samba share for ESS
|
||||
00 00 * * * /usr/local/monitoring/princeton/hostdump
|
||||
|
||||
# PreProduction report
|
||||
00 07 * * 3 /usr/local/monitoring/princeton/preprodreport | sort -k2,2 | mail -s "Pre-Production host report" chris@Princeton.EDU igubenko@Princeton.EDU epm-list@princeton.edu
|
||||
|
||||
# Load malicious IPs from emails to a SMB share for the SIEM
|
||||
00 01,13 * * * /usr/local/monitoring/princeton/siem_process
|
||||
|
||||
# Create Nagios contacts from LDAP groups authorized for Nagios, for authorization purposes (MK Livestatus, others)
|
||||
00 * * * * /usr/local/monitoring/princeton/create_auth_contacts_from_ldap
|
||||
|
||||
# AP Building report for Dave W. -- Student project is over - cancelled
|
||||
#*/5 * * * * /usr/local/monitoring/scripts/aruba_cjhsu/aos_ap_stats_pull
|
||||
|
||||
# NEED TO MIGRATE TO ServiceLater: Generate a list of Princeton VLAN's from Host Database
|
||||
##00 0 * * * /usr/local/monitoring/princeton/netgen > /usr/local/monitoring/etc/punets
|
||||
|
||||
# Copy rover hostfile
|
||||
#00 00,12 * * * . $HOME/.ssh/.ssh-agent >/dev/null 2>&1; /usr/bin/ssh drevil@heymon 2>/dev/null | tar --strip-components=1 -xf - -C /usr/local/monitoring/etc 2>/dev/null
|
||||
05 00,12 * * * . $HOME/.ssh/.ssh-agent >/dev/null 2>&1; /usr/bin/ssh drevil@heymon 2>/dev/null | dd of=/usr/local/monitoring/etc/hostfile-pager 2>/dev/null; sed '/^# \/rover\/pager.conf/,$!d' /usr/local/monitoring/etc/hostfile-pager > /usr/local/monitoring/etc/rover-pager; sed '/^# \/rover\/pager.conf/,$d' /usr/local/monitoring/etc/hostfile-pager > /usr/local/monitoring/etc/hostfile; rm -f /usr/local/monitoring/etc/hostfile-pager
|
||||
|
||||
50 09,15 * * * . $HOME/.ssh/.ssh-agent >/dev/null 2>&1; /usr/local/monitoring/princeton/rover2nag >/usr/local/monitoring/log/rover2nag.log 2>&1
|
||||
|
||||
# Load Hostdb entries for Nagios into the MySQL database "notify"
|
||||
00 03 * * * /usr/local/monitoring/princeton/hostdb_process > /usr/local/monitoring/log/hostdb_mysql.log 2>&1
|
||||
|
||||
# Get info from hostdb
|
||||
##30 04 * * * . $HOME/.ssh/.ssh-agent >/dev/null 2>&1; /usr/local/monitoring/princeton/puhostinfo >/usr/local/monitoring/log/puhostinfo.log 2>&1
|
||||
|
||||
### need to figure out what is creating the bloody user.js files in /tmp/tmp* dirs
|
||||
00 * * * * find /tmp -name user.js 2>/dev/null | sed "s/\/user.js//" | xargs rm -rf
|
||||
|
||||
# Check Naemon process
|
||||
*/5 * * * * res=`/usr/local/monitoring/naemon/plugins/check_nagios -F /usr/local/monitoring/log/naemon.log -e 2 -t 30 -v -C naemon.qh 2>&1`; /usr/local/monitoring/naemon/plugins/eventhandlers/submit_check_result ims204 Naemon $? "$res"
|
||||
|
||||
# NEED TO MIGRATE TO ServiceLater: Load a list of IP's that are not part of the PU IP ranges, though are in the host database, on a file share for SIEM consumption
|
||||
##00 23 * * * /usr/local/monitoring/princeton/non-pu-ip
|
||||
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# curl -c /tmp/cookie.txt --location -k "https://oampfsqual.princeton.edu:443/psp/pfsqual/EMPLOYEE/ERP/" | grep "Central Authentication Service"
|
||||
|
||||
http="http"
|
||||
uri=""
|
||||
search=""
|
||||
host=""
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
-S) http="https"; shift 1;;
|
||||
-H) host="$2"; shift 2;;
|
||||
-u) uri="$2"; shift 2;;
|
||||
-s) search="$2"; shift 2;;
|
||||
*) shift 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
tmpfile="/tmp/cookies.txt.$$"
|
||||
rm -Rf $tmpfile
|
||||
curl --silent -c $tmpfile --location -k "$http://$host$uri" > $tmpfile.output
|
||||
[ $? -ne 0 ] && echo "WARNING: $http://$host$uri did not respond properly" && exit 1
|
||||
if [ -n "$search" ]; then
|
||||
grep -q "$search" $tmpfile.output
|
||||
[ $? -ne 0 ] && echo "CRITICAL: Cannot find $search in $http://$host$uri" && exit 2
|
||||
echo "OK: Found $search in $http://$host$uri"
|
||||
fi
|
||||
exit 0
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue