Skip to content

Instantly share code, notes, and snippets.

define command {
command_name notify-service-ganglia
command_line /usr/bin/wget -q -O /dev/null "$CONTACTEMAIL$/api/events.php?action=add&start_time=now&summary=$NOTIFICATIONTYPE$ $SERVICEDESC$ $SERVICESTATE$&description=$SERVICEOUTPUT$&host_regex=$HOSTNAME$"
}
define command {
command_name notify-host-ganglia
command_line /usr/bin/wget -q -O /dev/null "$CONTACTEMAIL$/api/events.php?action=add&start_time=now&summary=$NOTIFICATIONTYPE$ $HOSTSTATE$&description=$HOSTOUTPUT$&host_regex=$HOSTNAME$"
}
## Prep
my $from = 'helpdesk@psu.edu';
if (lc($self->TicketObj->RequestorAddresses) ne $from) {
$RT::Logger->info("Ticket is NOT from $from");
return 0;
} else {
$RT::Logger->info("Ticket IS from $from");
return 1;
# ./check_v46 --wrapper-hostname ns1.ems.psu.edu --plugin-hostname-arg="-s" /usr/lib64/nagios/plugins/check_dns --no-proto-arg --debug -H smith.ait.psu.edu -a 128.118.58.69
debug: Doing protocol IPv6
debug: Lookup of ns1.ems.psu.edu for 10 returned: 2610:8:7800:20::66
debug: checking address 2610:8:7800:20::66
debug: Running '/usr/lib64/nagios/plugins/check_dns -H smith.ait.psu.edu -a 128.118.58.69 -s 2610:8:7800:20::66
debug: Plugin output 1st line: 'DNS OK: 1.914 second response time. smith.ait.psu.edu returns 128.118.58.69|time=1.914483s;;;0.000000'
debug: Reformatted performance data: 'ipv6_a1_time=1.914483s;;;0.000000'
debug: Plugin result: 0 (OK)
debug: Doing protocol IPv4
debug: Lookup of ns1.ems.psu.edu for 2 returned: 146.186.163.66
@acobaugh
acobaugh / mustache-test.cf
Last active February 9, 2017 01:56
CFEngine Mustache template with variable defaults
body common control {
bundlesequence => { "main" };
}
bundle agent main {
vars:
"var1" string => "this is var1";
"out1" string => string_mustache("{{vars.main.var1}}");
"out2" string => string_mustache("{{vars.main.var2}}");
@acobaugh
acobaugh / gist:8f2dd5992e4edc5ac550cfd564a838f8
Created February 9, 2017 01:58
CFEngine mustache template variable defaults: output
$ cf-agent -K -f `pwd`/test.cf
R: var1 = this is var1
R: var2 =
R: var2 w/ default = default
body common control {
bundlesequence => { "main" };
}
bundle agent main {
vars:
"notempty" string => "foo";
"notempty2" string => "bar";
"data_string" string => string_mustache("not empty = {{vars.main.notempty}} ; empty = {{^vars.main.empty}}default{{/vars.main.empty}} ; not empty with default = {{^vars.main.notempty2}}default{{/vars.main.notempty2}}");
reports:
vars:
any::
"el6_64_install_packages" slist => {
"cosign-psu-cgi",
"cosign-psu-factor-duo",
"jansson",
"perl-RPC-XML",
"perl-Crypt-SSLeay"
};
@acobaugh
acobaugh / gist:6988dbcdf179d5e8e86b9674c28f4c13
Created June 15, 2017 14:54
NSS_SDB_USE_CACHE=yes demonstration
$ strace -fc -e trace=access curl 'https://www.google.com' > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11576 0 11576 0 0 36381 0 --:--:-- --:--:-- --:--:-- 161k
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.000133 0 1506 1503 access
------ ----------- ----------- --------- --------- ----------------
100.00 0.000133 1506 1503 total
### Keybase proof
I hereby claim:
* I am acobaugh on github.
* I am andrewcobaugh (https://keybase.io/andrewcobaugh) on keybase.
* I have a public key ASArXu67f6ZPI0utHwJHdwN_Hlw0X9PBIj4AMpLuUDjg9Ao
To claim this, I am signing this object:
# node that is broken after adding fabric network:
2017-10-30T21:53:34.237047+00:00 cn1 bnx: [ID 328528 kern.info] NOTICE: bnx0: Copper link is up (1000Mbps, Full Duplex)
2017-10-30T21:53:34.237052+00:00 cn1 bnx: [ID 328528 kern.info] NOTICE: bnx0: Copper link is down
2017-10-30T21:53:34.237057+00:00 cn1 mac: [ID 435574 kern.info] NOTICE: bnx0 link up, 0 Mbps, half duplex
2017-10-30T21:53:34.237062+00:00 cn1 bnx: [ID 328528 kern.info] NOTICE: bnx0: Copper link is up (100Mbps, Full Duplex)
2017-10-30T21:53:34.237067+00:00 cn1 bnx: [ID 328528 kern.info] NOTICE: bnx0: Copper link is down
2017-10-30T21:53:34.237072+00:00 cn1 mac: [ID 435574 kern.info] NOTICE: bnx0 link up, 0 Mbps, half duplex
2017-10-30T21:53:34.237182+00:00 cn1 bnx: [ID 328528 kern.info] NOTICE: bnx2: Copper link is down
2017-10-30T21:53:34.237187+00:00 cn1 bnx: [ID 328528 kern.info] NOTICE: bnx4: Copper link is down
2017-10-30T21:53:34.237191+00:00 cn1 bnx: [ID 328528 kern.info] NOTICE: bnx3: Copper link is down