Skip to content

Instantly share code, notes, and snippets.

View w3ttr3y's full-sized avatar

William E. T. III w3ttr3y

View GitHub Profile
#!/bin/bash --restricted
##########################
## check_mounts
###########################
# A script to use as a Nagios plugin to check that a mount is actually mounted based on device, mount point and/or filesystem type
#
# The original intent of this script was to check that /data on our indexers was indeed mounted
# When they were first built the raid array wasn't always built, so some times they would come up without
# anything mounted on /data. When they would start Splunk, it would write to
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <fcntl.h>
#include <errno.h>
int main(int argc, char **argv) {
//##################
//## Parse Arguments (primitive)
# Do some normalization of program names
rewrite rewrite_program {
subst("CRON", "cron", value("PROGRAM"));
subst("/usr/sbin/cron", "cron", value("PROGRAM"), flags(ignore-case));
subst("postfix/anvil", "postfix-anvil", value("PROGRAM"));
subst("postfix/cleanup", "postfix-cleanup", value("PROGRAM"));
subst("postfix/pickup", "postfix-pickup", value("PROGRAM"));
subst("postfix/qmgr", "postfix-qmgr", value("PROGRAM"));
subst("postfix/scache", "postfix-scache", value("PROGRAM"));
subst("postfix/smtp", "postfix-smtp", value("PROGRAM"));

Keybase proof

I hereby claim:

  • I am w3ttr3y on github.
  • I am w3ttr3y (https://keybase.io/w3ttr3y) on keybase.
  • I have a public key ASCPm6kx-I6SltDZf-Wz2NkoIdoYJLR8RexW5LOxqaEt5Ao

To claim this, I am signing this object: