Skip to content

Just some server monitoring scripts I use

License

Notifications You must be signed in to change notification settings

thepoch/monitoring-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

monitoring-scripts

These are just some scripts I use to monitor my servers. I usually put them all in /usr/local/sbin.

  • monitorvars.conf - main configuration file. Set an IP address to exclude, as well as the EMAIL address to send notifications to.
  • monitordisk.sh - monitors disk usage. Creates a file in /tmp and sends its content to the EMAIL defined above.
  • monitorload.sh - monitors server load. Creates a file in /tmp and sends its content to the EMAIL defined above.

The scripts above should be have crontab entries for them. I usually set something like:

#Ansible: monitordisk.sh
0 7,15,23 * * * /usr/local/sbin/monitordisk.sh
#Ansible: monitorload.sh
*/10 * * * * /usr/local/sbin/monitorload.sh
  • ssh-alert.sh - script to send an email notification whenever someone successfully signs in using ssh. Must be called via pam. Add in /etc/pam.d/sshd the following line:

    session optional pam_exec.so seteuid /usr/local/sbin/ssh-alert.sh

About

Just some server monitoring scripts I use

Resources

License

Stars

Watchers

Forks

Languages