This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This fact will pull the Splunk Universal Forwarder version and then normalize it so you can use versioncmp in Puppet to update your Splunk Universal Forwarders. | |
#Splunk Universal Forwarder Version | |
Facter.add("SplunkUF_Version") do | |
confine :osfamily => "RedHat" | |
setcode do | |
SplunkUF_Version = Facter::Util::Resolution.exec("/opt/splunkforwarder/bin/splunk --version | awk {'print $4'}") | |
if SplunkUF_Version.length < 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This will have Puppet send it's changes to Graphite and mark a vertical line on any graph you create to show when the change was made and make it easy to correlate before and after utilization. | |
require 'puppet' | |
require 'yaml' | |
require 'socket' | |
require 'time' | |
Puppet::Reports.register_report(:graphite_event) do | |
configfile = File.join([File.dirname(Puppet.settings[:config]), "graphite_event.yaml"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This script pulls the drive path and sets the check command for NRPE. It is outputted to a file that is included int he nrpe.cfg file. | |
rm -f check_disk.cfg 2> /dev/null; | |
df -H | grep "/dev" | awk {'print $1'}> out.txt | |
sed -i "s|tmpfs|/dev/shm|g" out.txt; | |
no="0" | |
while read line | |
do | |
no=$[$no+1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This fact will pull securiy groups and users who have access if you are using PBIS. | |
Facter.add("Domain_Access") do | |
confine :osfamily => "RedHat" | |
setcode do | |
if File.directory? "/opt/likewise" | |
Domain_Access = `/opt/likewise/bin/lwconfig --detail RequireMembershipOf | grep '"' | sed -e 's/^"//' -e 's/"$//' | awk -F'\\' '{print $3}'` | |
$Access = split($Domain_Access, ' ') | |
Domain_Access | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This will pull the package version of the NRPE client | |
Facter.add("NRPE_Version") do | |
confine :osfamily => "RedHat" | |
setcode do | |
NRPE_Version = `/bin/rpm -q --queryformat "%{VERSION}" nrpe` | |
NRPE_Version | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Disks to check for Nagios alerting | |
Facter.add("Check_Disks") do | |
confine :osfamily => "RedHat" | |
setcode do | |
Check_Disks = Facter::Util::Resolution.exec("cat /etc/nagios/check_disk.cfg | cut -c 9-19") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NSClient++ Version | |
Facter.add("NSClient_Version") do | |
confine :osfamily => "Windows" | |
setcode do | |
NSClient_Version = Facter::Util::Resolution.exec("command to pull version") | |
#only use the below if and while in the case of normalizing version numbers | |
#the below code is assuming symantec versioning is being used (ex. 3.5.1) | |
#if NSClient_Version.length < 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /etc/vmware-tools/services.sh /etc/init.d/vmware-tools | |
vim /etc/init.d/vmware-tools | |
Paste the following just below the line ##VMWARE_INIT_INFO## and save: | |
chkconfig: 235 03 99 | |
chkconfig --add vmware-tools | |
chkconfig vmware-tools on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
# | |
# chkconfig: 35 20 30 | |
# description: A problem exists when cloining a virtual machine | |
# that is currently up when using vmware. The problem | |
# this script solves is to remove the udev rule for | |
# networking. | |
# source function library | |
. /etc/rc.d/init.d/functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# facter rhelkey | |
# | |
# This fact will determine which patching group should be applied | |
# to the server when added to satellite so the need to manually | |
# add servers to groups will be eliminated. | |
Facter.add('rhelkey') do | |
setcode do | |
myenv = Facter.value('hostname').scan(/(^\D+\d)/).to_s | |
odd_even = Facter.value('hostname').scan(/^\D+\d\D+(\d+)/).to_s |
OlderNewer