Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
#
# This file, gist, is generated code.
# Please DO NOT EDIT or send patches for it.
#
# Please take a look at the source from
# http://github.com/defunkt/gist
# and submit patches against the individual files
# that build gist.
#
#!/usr/bin/env python
# Author: Nick Anderson <nick.anderson@motorola.com>
# Rack PDU AMP Load Aggregation
# Designed for use with APC 7840
# Scinario: You have 2 legs of power A and B, each rack has 1 PDU on each leg
# and you need to monitor the aggregate and individual AMP Load
import subprocess
from optparse import *
my $cmd;
@ssh_keys = ("$ENV{HOME}/.ssh/zenoss",
"$ENV{HOME}/.ssh/nss_restart",
"$ENV{HOME}/.ssh/id_rsa",
"$ENV{HOME}/.ssh/id_dsa",
"$ENV{HOME}/.ssh/identity",);
my $ssh = Net::SSH::Perl->new($host, identity_files => @ssh_keys);
$ssh->login($user, $pass);
bundle agent openssh {
files:
linux::
"/etc/ssh/sshd_config"
perms => m_u_g("0700","root","root"),
copy_from => remote_copy("$(g.configfiles)/etc/sshd_config","$(g.phost)"),
action => immediate,
classes => if_repaired( "restart_ssh" );
processes:
Tis a test
Tis a test
more