DRSM Documentation Live demo Downloads

Thresholds and alerts

Every check has default warning and error levels that suit most hosts. Change them for all hosts in _defaults.conf or for one host in its host file, then decide who gets the email and text alerts.

Plugin settings

Set a plugin's setting as <category>_<name>_<SETTING>=value in etc/hosts/_defaults.conf for every host, or in etc/hosts/<host>.conf for one host. Every plugin also takes TIMEOUT.

$ vi ~/drsm/etc/hosts/db1.conf

storage_disk_WARN=80
storage_disk_CRIT=90
storage_disk_SKIP="/tmp /usr1"
core_memory_MIN_AVAIL_MB=1024
core_load_WARN=16
core_users_ERROR_USERS="root"
PluginSettingDefaultMeaning
core/cpuWARN, CRIT85, 95Total CPU use in percent
NUMPROCS100Processes listed in the report
SAMPLE_SECS2Seconds between the two /proc/stat samples
TEMPSyesReport CPU temperatures when lm_sensors is installed
core/loadWARN, CRIT2x, 4x CPUs15 minute load average; empty scales with the CPU count
core/memoryMIN_AVAIL_MB256Error at or below this much available memory
SWAP_WARN_MB1024Warning at or above this much swap in use
NUMPROCS100Processes listed in the report
core/usersERROR_USERS, WARN_USERSnoneUser names that raise an error or warning when logged in
storage/diskWARN, CRIT90, 99Space and inode use in percent
SKIPnoneMount points to skip
FSTYPESxfs, ext2/3/4, btrfs, zfs, f2fs, jfs, reiserfsLocal file system types to check
storage/raidMEGACLI/opt/MegaRAID/MegaCli/MegaCli64LSI MegaRAID utility, needs sudo
network/nicsNICSall activeInterfaces to check
MAX_DROPPED, MAX_COLLISIONS, MAX_ERRORS1000, 100, 100Alert levels during the sample window
SAMPLE_SECS5Sample window in seconds
network/pingCOUNT, DEADLINE3, 30Packets and deadline, any reply passes
network/http, https, ftpURL<scheme>://<host>URL to test
CONNECT_TIMEOUT, MAX_TIME, RETRIES15, 30, 2curl limits

A Web server that answers with an error page or a redirect still counts as up. An invalid HTTPS certificate counts as a failure.

Profiles for system_report.sh

Sites still on system_report.sh set levels in the $CONFIGdir/<host>_profile.sh script generated for each host. Edit the arguments inside the double quotes:

LineArguments
disk_checks.sh '/tmp /usr1' 80 90Mounts to skip (or NONE), warning %, error %
cpu_checks.sh 75 85 200Warning %, error %, processes listed
load_checks.sh 100 250Warning and error 15 minute load
memory_checks.sh 128 4096 300Error at MB available, warning at MB swap used, processes listed
network_checks.sh '' 5000 500 500 10NICs ('' for all), dropped, collisions, errors, sample seconds
user_checks.sh 'usr1 usr2' 'usr4'Users that raise an error, users that raise a warning

The scripts are copied to $REMOTEdir on each host, drsm/health_check_scripts under the remote user's home by default. Delete a profile to have a new one generated. utils/migrate_systems_dat.sh carries these levels over to host files.

Email and text alerts

Alerts go to root on the monitor host until you add addresses. An alert for the same problem goes out at most once every 4 hours, so a host that stays down does not flood your inbox. Each connectivity alert includes the host's IMPACT line.

$ source ~/.drsm.sh
$ vi $DRSMHOME/etc/alert.email.list

export EMAILlist="root,ops@example.com"
export TEXTlist="5555555555@vtext.com"

$ $DRSMHOME/bin/test_alert.sh

For texts, use the carrier's email to text address, such as number@vtext.com (Verizon) or number@tmomail.net (T-Mobile).

Several carriers have shut down their email to text gateways, including AT&T (2025), Sprint, Nextel and Cingular. Check with your carrier before relying on text alerts.

DRSM uses the first mail, mailx or s-nail command it finds. Set MAILcmd in ~/.drsm.sh to use another.

Relay host

If your network has a mail relay, point postfix at it:

# vi /etc/postfix/main.cf

relayhost = 192.168.1.12

# systemctl restart postfix

Smart host

Without a relay, or on a cloud server where port 25 is blocked, send through an external mail account on port 587:

# vi /etc/postfix/main.cf

smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/relay_passwd
relayhost = [smtp.gmail.com]:587
smtp_generic_maps = hash:/etc/postfix/generic

# vi /etc/postfix/relay_passwd
[smtp.gmail.com]:587 USERNAME:PASSWORD

# chmod 600 /etc/postfix/relay_passwd
# postmap /etc/postfix/relay_passwd
# rm /etc/postfix/relay_passwd      # postmap made relay_passwd.db

# vi /etc/postfix/generic
root@localdomain.local  username@example.com
@localdomain.local      username@example.com

# postmap /etc/postfix/generic
# systemctl restart postfix
# tail -f /var/log/maillog

The generic map gives outgoing mail a valid From address. On Debian and Ubuntu the log is /var/log/mail.log.