Simple Ruby script that sends a slack message. Like Slackcat or others, but I needed more options. Uses slack-notifier gem.
YMMV.
Check count of members in a Juniper virtual chassis
| if ($::operatingsystem == 'Ubuntu') { | |
| package { 'openssh-server' : | |
| ensure => latest, | |
| } | |
| service { 'ssh': | |
| ensure => 'running', | |
| enable => true, | |
| require => Package['openssh-server'], | |
| } |
This is a quick nagios plugin / script to query an ESXi server and grab the "overall status" parameter. This is a parameter each host should respond to and will reflect if any alarms are active on the system. See the official documentation for more info.
This should give notice in the event of a power supply failure, memory errors, loss of connectivity to datastore, etc.
The script only requires a Hostname, but allows for the providing of both a hostname and IP address. The hostname is required to make sure that the status being returned is for the correct host (I don't trust CIM to always return the hosts inside the "hostFolder" in the same order). It is actually used to query the API for the provided string, so it must be accurate and reflect what the system thinks its hostname is. Our environment and conditions mandated this. YMMV.
A modification to the decade-old check_multiaddr perl script so that it doesn't chop off output from the called script.
| #/bin/bash | |
| IP="10.x.x.x" | |
| #Look for number of received pings, if 0 received then restart OpenVPN service | |
| RESULT=`ping -c 2 -W 1 $IP | grep transmitted | awk '{print $4}'` | |
| if [ $? -ne 0 ] && [ $RESULT -eq 0 ] | |
| then |
| (([0-9a-f]{2}:){5}[0-9a-f]{2}) |
| #!/bin/sh | |
| # | |
| ###################################################################################################### | |
| # | |
| # Description: | |
| # Backup pfSense 2.3 Firewalls to Local Disk | |
| # | |
| ###################################################################################################### | |
| # | |
| # Author: Nick Peelman |
| class puppetlabs { | |
| # Install Puppet repository and call apt-get update | |
| case $operatingsystem { | |
| ubuntu: { | |
| $key = "4BD6EC30" | |
| exec { 'apt-key puppetlabs': | |
| path => "/bin:/usr/bin", | |
| unless => "apt-key list | grep '${key}' | grep -v expired", | |
| command => "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${key}", | |
| } |