forked from aqzt/kjyw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
## ansible_nagios_em2 2017-01-13 | ||
## http://www.aqzt.com | ||
## email: [email protected] | ||
## robert yu | ||
## centos 6 | ||
|
||
ps -ef | grep 'nagios' | grep 'nrpe' | grep -v 'grep' | awk '{print $2}' | xargs kill | ||
num1=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep em2 | grep public123 | awk -F ' ' '{print $11}' | awk -F ',' '{print $2}'` | ||
num2=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep em2 | grep public123 | awk -F ' ' '{print $11}'` | ||
num5=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep em2 | grep public123 | awk -F ' ' '{print $13}' | awk -F ',' '{print $2}'` | ||
num6=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep em2 | grep public123 | awk -F ' ' '{print $13}'` | ||
var1=`expr $num1 + 10000` | ||
var2=`expr $num5 + 10000` | ||
echo "w=$num1 c=$num5" | ||
echo "w=$var1 c=$var2" | ||
sed -i "s/-w $num2/-w $var1,$var1/g" /usr/local/nagios/etc/nrpe.cfg | ||
sed -i "s/-c $num6/-c $var2,$var2/g" /usr/local/nagios/etc/nrpe.cfg | ||
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
## ansible_nagios_ss 2017-01-13 | ||
## http://www.aqzt.com | ||
## email: [email protected] | ||
## robert yu | ||
## centos 6 | ||
|
||
ps -ef | grep 'nagios' | grep 'nrpe' | grep -v 'grep' | awk '{print $2}' | xargs kill | ||
num1=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep check_ss | grep nagios | awk -F ' ' '{print $2}'` | ||
num2=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep check_ss | grep nagios | awk -F ' ' '{print $2}'` | ||
num5=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep check_ss | grep nagios | awk -F ' ' '{print $3}'` | ||
num6=`cat /usr/local/nagios/etc/nrpe.cfg |grep -v "#" |grep check_ss | grep nagios | awk -F ' ' '{print $3}'` | ||
var1=`expr $num1 + 2000` | ||
var2=`expr $num5 + 2000` | ||
echo "w=$num1 c=$num5" | ||
echo "w=$var1 c=$var2" | ||
sed -i "s/check_ss.sh $num1 $num5/check_ss.sh $var1 $var2/g" /usr/local/nagios/etc/nrpe.cfg | ||
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d |