SlideShare a Scribd company logo
Tel 91 020 66018100
UIN 611977845
BoaT ID PADHIYN
Email nikunj.padhiyar@bt.com
UIN 611434799
BoaT ID TODIMX
Email mayank.todi@bt.com
dyl09079app12
execute.sh
********************************************************************************
********************************************************************************
**************
Mike cmd for Load error:
find / -name notifications -type d
logs then come:
find: `/usr/lib/ocf': Permission denied
find: `/usr/lost+found': Permission denied
find: `/usr/lib64/audit': Permission denied
find: `/etc/polkit-1/localauthority': Permission denied
find: `/etc/opt/quest/sudo/sudoers.d': Permission denied
find: `/etc/ntp/crypto': Permission denied
find: `/etc/lvm/archive': Permission denied
find: `/etc/lvm/cache': Permission denied
find: `/etc/lvm/backup': Permission denied
find: `/etc/pki/CA/private': Permission denied
find: `/etc/pki/rsyslog': Permission denied
find: `/etc/chef': Permission denied
find: `/etc/dhcp': Permission denied
find: `/etc/raddb/sql': Permission denied
find: `/etc/raddb/sites-available': Permission denied
find: `/etc/raddb/certs': Permission denied
find: `/etc/raddb/modules': Permission denied
find: `/etc/raddb/sites-enabled': Permission denied
find: `/etc/puppet/ssl': Permission denied
find: `/etc/selinux/targeted/modules/active': Permission denied
find: `/etc/audit': Permission denied
find: `/etc/audisp': Permission denied
$ls -la /opt/omd/sites/e2eslave1/local/share/check_mk/notifications
logs then:
total 16
drwxr-xr-x. 2 e2eslave1 e2eslave1 4096 Dec 23 2015 ./
drwxr-xr-x. 10 e2eslave1 e2eslave1 4096 Oct 1 2014 ../
-rwxr-xr-x. 1 e2eslave1 root 3006 Dec 23 2015 omnibus_trap*
-rwxrwxr-x. 1 e2eslave1 e2eslave1 2717 Dec 10 2015 smarts_trap*
$ ls -la /opt/omd/versions/1.20/skel/local/share/check_mk/notifications
$ ls -la /opt/omd/versions/1.20/share/check_mk/notifications
OMD[e2eslave1]:/$ ls -la
/opt/omd/versions/1.20/skel/local/share/check_mk/notifications
total 8
drwxr-xr-x. 2 root root 4096 Aug 20 2014 ./
drwxr-xr-x. 10 root root 4096 Oct 1 2014 ../
$cat /opt/omd/sites/e2eslave1/local/share/check_mk/notifications/omnibus_trap
#!/bin/sh
#Send Omnibus / AutoClarify Trap (Bridge Queue, Priority)
#Send different commands if the Source of the notification is from a Service
Check or a Host Check
if [ "$NOTIFY_WHAT" == "SERVICE" ]; then
#Passing the arguments into a seperate variable, then passing to command
as an Array (otherwise some variables weren't escaping properly)
ARGS1=(-v 2c -c public 62.239.184.46 '' NAGIOS-NOTIFY-MIB::nSvcEvent
nSvcHostname s "$NOTIFY_HOSTNAME" nSvcHostStateID i $NOTIFY_HOSTSTATEID nSvcDesc
s "$NOTIFY_SERVICEDESC" nSvcStateID i $NOTIFY_SERVICESTATEID nSvcAttempt i
$NOTIFY_SERVICEATTEMPT nSvcDurationSec i $NOTIFY_SERVICEDURATIONSEC
nSvcGroupName s "$NOTIFY_SERVICEGROUPNAME" nSvcLastCheck i
$NOTIFY_LASTSERVICECHECK nSvcLastChange i $NOTIFY_LASTSERVICESTATECHANGE
nSvcOutput s "$NOTIFY_SERVICEOUTPUT" nSvcHostAlias s "AUTOCLARIFY:
$NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2")
ARGS2=(-v 2c -c public 62.239.187.23 '' NAGIOS-NOTIFY-MIB::nSvcEvent
nSvcHostname s "$NOTIFY_HOSTNAME" nSvcHostStateID i $NOTIFY_HOSTSTATEID nSvcDesc
s "$NOTIFY_SERVICEDESC" nSvcStateID i $NOTIFY_SERVICESTATEID nSvcAttempt i
$NOTIFY_SERVICEATTEMPT nSvcDurationSec i $NOTIFY_SERVICEDURATIONSEC
nSvcGroupName s "$NOTIFY_SERVICEGROUPNAME" nSvcLastCheck i
$NOTIFY_LASTSERVICECHECK nSvcLastChange i $NOTIFY_LASTSERVICESTATECHANGE
nSvcOutput s "$NOTIFY_SERVICEOUTPUT" nSvcHostAlias s "AUTOCLARIFY:
$NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2")
/usr/bin/snmptrap "${ARGS1[@]}"
/usr/bin/snmptrap "${ARGS2[@]}"
elif [ "$NOTIFY_WHAT" == "HOST" ]; then
if [ "$NOTIFY_HOSTSTATETYPE" == "HARD" ]; then
HOSTSTATETYPE=0
else
HOSTSTATETYPE=1
fi
#Passing the arguments into a seperate variable, then passing to command
as an Array (otherwise some variables weren't escaping properly)
ARGS1=(-v 2c -c public 62.239.184.46 '' NAGIOS-NOTIFY-MIB::nHostEvent
nHostname s "$NOTIFY_HOSTNAME" nHostStateID i $NOTIFY_HOSTSTATEID nHostStateType
i $HOSTSTATETYPE nHostAttempt i $NOTIFY_HOSTATTEMPT nHostDurationSec i
$NOTIFY_HOSTDURATIONSEC nHostGroupName s "$NOTIFY_HOSTGROUPNAME" nHostLastCheck
i $NOTIFY_LASTHOSTCHECK nHostLastChange i $NOTIFY_LASTHOSTSTATECHANGE
nHostOutput s "$NOTIFY_HOSTOUTPUT" nHostAlias s "AUTOCLARIFY:
$NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2")
ARGS2=(-v 2c -c public 62.239.187.23 '' NAGIOS-NOTIFY-MIB::nHostEvent
nHostname s "$NOTIFY_HOSTNAME" nHostStateID i $NOTIFY_HOSTSTATEID nHostStateType
i $HOSTSTATETYPE nHostAttempt i $NOTIFY_HOSTATTEMPT nHostDurationSec i
$NOTIFY_HOSTDURATIONSEC nHostGroupName s "$NOTIFY_HOSTGROUPNAME" nHostLastCheck
i $NOTIFY_LASTHOSTCHECK nHostLastChange i $NOTIFY_LASTHOSTSTATECHANGE
nHostOutput s "$NOTIFY_HOSTOUTPUT" nHostAlias s "AUTOCLARIFY:
$NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2")
/usr/bin/snmptrap "${ARGS1[@]}"
/usr/bin/snmptrap "${ARGS2[@]}"
echo "${ARGS1[@]}" >> /tmp/logout
else
echo "ERROR: Invalid Check Type Passed" >> /tmp/logout
********************************************************************************
********************************************************************************
**************
1ambchops
F[k70Ux!
blt11127001 10.54.148.54 E2ESlave1 b6&D9vq!
root password: F[k70Ux!
******************************
10.54.148.55
$cp -r ruby rubybackup
******************************
root password: muD9$5!G
there might be an unpacked version of Ruby in /tmp
as root run gem list
wget https://rubygems.org/gems/net-ssh
For Current net-ssh releases require Ruby 2.0 or later,So anyhow we have to
install Ruby 2.0
*****************************
10.54.148.55
su - e2eslave1
/usr/local/lib/ruby/gems/2.1.0
/usr/lib/ruby/gems/2.1.0/gems/chef-11.12.8/spec/unit/knife/client_create_spec.rb
/usr/bin/ruby
[root@blt11127001 usr]# cd uname -a
bash: cd: uname: No such file or directory
[root@blt11127001 usr]# uname -a
Linux blt11127001 2.6.39-400.24.1.el6uek.x86_64 #1 SMP Wed May 15 11:46:52 PDT
2013 x86_64 x86_64 x86_64 GNU/Linux
[root@blt11127001 usr]#
[root@blt11127001 usr]#
[root@blt11127001 usr]#
[root@blt11127001 usr]# ruby -v
ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
[root@blt11127001 usr]#
[root@blt11127001 usr]#
[root@blt11127001 usr]#
[root@blt11127001 gems]# gem install chef-helpers
ERROR: http://rubygems.org/ does not appear to be a repository
ERROR: Could not find a valid gem 'chef-helpers' (>= 0) in any repository
[root@blt11127001 gems]#
This may be automatically included in the Chef build in the future, but at the
moment is still a manual step.
Due to the new way we monitor Windows Services, we connect via SSH and use a
small Netcat EXE to connect to the Check_MK Service locally. Unfortunately using
the standard SSH Commands using this method seems to return a "chunked"
response, where half the output of the agent doesn't get sent over correctly.
The solution to this was to wrap up the Datasoruce call into a Ruby script,
which waits until the entire response is recieved before passing it on. The
script has also been extended to query any kind of OS by passing the IP + OS
into the script.
It should be placed in the OMD Sites Home Directory, and test that the Site User
can call it correctly.
It is available on SVN in the Chef Repo (under Misc)
/var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checkman/.svn
/var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checks/.svn
/var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/pnp-templates/.svn
/var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checkman/.svn
/var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checks/.svn
/var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_pnptemplates/.svn
Example to wget:
/var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checkman/.svn
/var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checks/.svn
/var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/pnp-templates/.svn
/var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checkman/.svn
/var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checks/.svn
/var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_pnptemplates/.svn

More Related Content

What's hot (20)

PPTX
Introduction to the new official C# Driver developed by 10gen
MongoDB
 
PDF
Cleaner, Leaner, Meaner: Refactoring your jQuery
Rebecca Murphey
 
PDF
Add edit delete in Codeigniter in PHP
Vineet Kumar Saini
 
TXT
Tag Joz
Ai Tsf
 
PDF
Mongo db for c# developers
Simon Elliston Ball
 
PDF
mdpress(MarkDown Press)を使ったプレゼンテーション作成
達郎 植田
 
PDF
Country State City Dropdown in PHP
Vineet Kumar Saini
 
PPTX
FP512 Cookies sessions
Fatin Fatihayah
 
PDF
How to build a pure evil Magento module
AOE
 
PDF
smartdc by Ruby
ogom_
 
PDF
Coding website
PutuMahendra Wijaya
 
PDF
PythonでJWT生成からボット作成、投稿までやってみた
itoxdev
 
PDF
How to work with legacy code PHPers Rzeszow #2
Michał Kruczek
 
PDF
How to work with legacy code
Michał Kruczek
 
PDF
Magento2&java script (2)
EvgeniyKapelko1
 
PPTX
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
LogeekNightUkraine
 
PDF
Keep It Simple Security (Symfony cafe 28-01-2016)
Oleg Zinchenko
 
PDF
Implementing JMS Integration Solutions with WSO2 ESB
WSO2
 
PPTX
Windows Phone 8 Sensors
David Isbitski
 
DOCX
Php update and delet operation
syeda zoya mehdi
 
Introduction to the new official C# Driver developed by 10gen
MongoDB
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Rebecca Murphey
 
Add edit delete in Codeigniter in PHP
Vineet Kumar Saini
 
Tag Joz
Ai Tsf
 
Mongo db for c# developers
Simon Elliston Ball
 
mdpress(MarkDown Press)を使ったプレゼンテーション作成
達郎 植田
 
Country State City Dropdown in PHP
Vineet Kumar Saini
 
FP512 Cookies sessions
Fatin Fatihayah
 
How to build a pure evil Magento module
AOE
 
smartdc by Ruby
ogom_
 
Coding website
PutuMahendra Wijaya
 
PythonでJWT生成からボット作成、投稿までやってみた
itoxdev
 
How to work with legacy code PHPers Rzeszow #2
Michał Kruczek
 
How to work with legacy code
Michał Kruczek
 
Magento2&java script (2)
EvgeniyKapelko1
 
Yuriy Voziy "Fantastic Template Strings and Where to Use Them"
LogeekNightUkraine
 
Keep It Simple Security (Symfony cafe 28-01-2016)
Oleg Zinchenko
 
Implementing JMS Integration Solutions with WSO2 ESB
WSO2
 
Windows Phone 8 Sensors
David Isbitski
 
Php update and delet operation
syeda zoya mehdi
 

Similar to load errorcmd (20)

PDF
CentOS Linux Server Hardening
MyOwn Telco
 
DOCX
Really useful linux commands
Michael J Geiser
 
PPTX
Creating "Secure" PHP applications, Part 2, Server Hardening
archwisp
 
PDF
unixtoolbox
wensheng wei
 
PDF
2345014 unix-linux-bsd-cheat-sheets-i
Logesh Kumar Anandhan
 
PPTX
InSpec Workshop at Velocity London 2018
Mandi Walls
 
PDF
Jana treek 4
Jana Treek
 
PDF
KCC_Final.pdf
Oleg Sehelin
 
PDF
Linux 系統管理與安全:基本 Linux 系統知識
維泰 蔡
 
PDF
Hacking the swisscom modem
Cyber Security Alliance
 
DOCX
Linux or unix interview questions
Teja Bheemanapally
 
PDF
Automating Compliance with InSpec - Chef Singapore Meetup
Matt Ray
 
PDF
Web Server Free Bsd
Kwanchai Charoennet
 
PDF
SANS @Night There's Gold in Them Thar Package Management Databases
Phil Hagen
 
PDF
Debian 5 Hardening Tips
s3m1llon
 
KEY
Ubic-public
Vyacheslav Matyukhin
 
TXT
Nouveau document texte
Sai Ef
 
TXT
Yy
yygh
 
TXT
Yy
yygh
 
CentOS Linux Server Hardening
MyOwn Telco
 
Really useful linux commands
Michael J Geiser
 
Creating "Secure" PHP applications, Part 2, Server Hardening
archwisp
 
unixtoolbox
wensheng wei
 
2345014 unix-linux-bsd-cheat-sheets-i
Logesh Kumar Anandhan
 
InSpec Workshop at Velocity London 2018
Mandi Walls
 
Jana treek 4
Jana Treek
 
KCC_Final.pdf
Oleg Sehelin
 
Linux 系統管理與安全:基本 Linux 系統知識
維泰 蔡
 
Hacking the swisscom modem
Cyber Security Alliance
 
Linux or unix interview questions
Teja Bheemanapally
 
Automating Compliance with InSpec - Chef Singapore Meetup
Matt Ray
 
Web Server Free Bsd
Kwanchai Charoennet
 
SANS @Night There's Gold in Them Thar Package Management Databases
Phil Hagen
 
Debian 5 Hardening Tips
s3m1llon
 
Nouveau document texte
Sai Ef
 
Yy
yygh
 
Yy
yygh
 
Ad

More from ♛Kumar Aneesh♛ (19)

TXT
Introduction about Kubernates Cluster
♛Kumar Aneesh♛
 
TXT
Live issues resolution on Kubernates Cluster
♛Kumar Aneesh♛
 
TXT
My onboarding
♛Kumar Aneesh♛
 
TXT
Monitor it accesspending
♛Kumar Aneesh♛
 
TXT
Monitor it access
♛Kumar Aneesh♛
 
TXT
Missing on both stacks
♛Kumar Aneesh♛
 
TXT
tp smarts_onboarding
♛Kumar Aneesh♛
 
TXT
derby onboarding (1)
♛Kumar Aneesh♛
 
TXT
Issues chmk (1)
♛Kumar Aneesh♛
 
TXT
Inventory after onboarding
♛Kumar Aneesh♛
 
TXT
Implementation c100229805
♛Kumar Aneesh♛
 
TXT
Icmp s outh
♛Kumar Aneesh♛
 
TXT
Hws&reigate south fitzoy
♛Kumar Aneesh♛
 
TXT
Hempoint
♛Kumar Aneesh♛
 
TXT
Dmctl cmd
♛Kumar Aneesh♛
 
PDF
Asg dashboard usage_guide_v1
♛Kumar Aneesh♛
 
Introduction about Kubernates Cluster
♛Kumar Aneesh♛
 
Live issues resolution on Kubernates Cluster
♛Kumar Aneesh♛
 
My onboarding
♛Kumar Aneesh♛
 
Monitor it accesspending
♛Kumar Aneesh♛
 
Monitor it access
♛Kumar Aneesh♛
 
Missing on both stacks
♛Kumar Aneesh♛
 
tp smarts_onboarding
♛Kumar Aneesh♛
 
derby onboarding (1)
♛Kumar Aneesh♛
 
Issues chmk (1)
♛Kumar Aneesh♛
 
Inventory after onboarding
♛Kumar Aneesh♛
 
Implementation c100229805
♛Kumar Aneesh♛
 
Icmp s outh
♛Kumar Aneesh♛
 
Hws&reigate south fitzoy
♛Kumar Aneesh♛
 
Asg dashboard usage_guide_v1
♛Kumar Aneesh♛
 
Ad

Recently uploaded (20)

PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Rethinking Security Operations - SOC Evolution Journey.pdf
Haris Chughtai
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
July Patch Tuesday
Ivanti
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Darren Mills The Migration Modernization Balancing Act: Navigating Risks and...
AWS Chicago
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 

load errorcmd

  • 1. Tel 91 020 66018100 UIN 611977845 BoaT ID PADHIYN Email [email protected] UIN 611434799 BoaT ID TODIMX Email [email protected] dyl09079app12 execute.sh ******************************************************************************** ******************************************************************************** ************** Mike cmd for Load error: find / -name notifications -type d logs then come: find: `/usr/lib/ocf': Permission denied find: `/usr/lost+found': Permission denied find: `/usr/lib64/audit': Permission denied find: `/etc/polkit-1/localauthority': Permission denied find: `/etc/opt/quest/sudo/sudoers.d': Permission denied find: `/etc/ntp/crypto': Permission denied find: `/etc/lvm/archive': Permission denied find: `/etc/lvm/cache': Permission denied find: `/etc/lvm/backup': Permission denied find: `/etc/pki/CA/private': Permission denied find: `/etc/pki/rsyslog': Permission denied find: `/etc/chef': Permission denied find: `/etc/dhcp': Permission denied find: `/etc/raddb/sql': Permission denied find: `/etc/raddb/sites-available': Permission denied find: `/etc/raddb/certs': Permission denied find: `/etc/raddb/modules': Permission denied find: `/etc/raddb/sites-enabled': Permission denied find: `/etc/puppet/ssl': Permission denied find: `/etc/selinux/targeted/modules/active': Permission denied find: `/etc/audit': Permission denied find: `/etc/audisp': Permission denied $ls -la /opt/omd/sites/e2eslave1/local/share/check_mk/notifications logs then: total 16 drwxr-xr-x. 2 e2eslave1 e2eslave1 4096 Dec 23 2015 ./ drwxr-xr-x. 10 e2eslave1 e2eslave1 4096 Oct 1 2014 ../ -rwxr-xr-x. 1 e2eslave1 root 3006 Dec 23 2015 omnibus_trap* -rwxrwxr-x. 1 e2eslave1 e2eslave1 2717 Dec 10 2015 smarts_trap* $ ls -la /opt/omd/versions/1.20/skel/local/share/check_mk/notifications $ ls -la /opt/omd/versions/1.20/share/check_mk/notifications OMD[e2eslave1]:/$ ls -la
  • 2. /opt/omd/versions/1.20/skel/local/share/check_mk/notifications total 8 drwxr-xr-x. 2 root root 4096 Aug 20 2014 ./ drwxr-xr-x. 10 root root 4096 Oct 1 2014 ../ $cat /opt/omd/sites/e2eslave1/local/share/check_mk/notifications/omnibus_trap #!/bin/sh #Send Omnibus / AutoClarify Trap (Bridge Queue, Priority) #Send different commands if the Source of the notification is from a Service Check or a Host Check if [ "$NOTIFY_WHAT" == "SERVICE" ]; then #Passing the arguments into a seperate variable, then passing to command as an Array (otherwise some variables weren't escaping properly) ARGS1=(-v 2c -c public 62.239.184.46 '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s "$NOTIFY_HOSTNAME" nSvcHostStateID i $NOTIFY_HOSTSTATEID nSvcDesc s "$NOTIFY_SERVICEDESC" nSvcStateID i $NOTIFY_SERVICESTATEID nSvcAttempt i $NOTIFY_SERVICEATTEMPT nSvcDurationSec i $NOTIFY_SERVICEDURATIONSEC nSvcGroupName s "$NOTIFY_SERVICEGROUPNAME" nSvcLastCheck i $NOTIFY_LASTSERVICECHECK nSvcLastChange i $NOTIFY_LASTSERVICESTATECHANGE nSvcOutput s "$NOTIFY_SERVICEOUTPUT" nSvcHostAlias s "AUTOCLARIFY: $NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2") ARGS2=(-v 2c -c public 62.239.187.23 '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s "$NOTIFY_HOSTNAME" nSvcHostStateID i $NOTIFY_HOSTSTATEID nSvcDesc s "$NOTIFY_SERVICEDESC" nSvcStateID i $NOTIFY_SERVICESTATEID nSvcAttempt i $NOTIFY_SERVICEATTEMPT nSvcDurationSec i $NOTIFY_SERVICEDURATIONSEC nSvcGroupName s "$NOTIFY_SERVICEGROUPNAME" nSvcLastCheck i $NOTIFY_LASTSERVICECHECK nSvcLastChange i $NOTIFY_LASTSERVICESTATECHANGE nSvcOutput s "$NOTIFY_SERVICEOUTPUT" nSvcHostAlias s "AUTOCLARIFY: $NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2") /usr/bin/snmptrap "${ARGS1[@]}" /usr/bin/snmptrap "${ARGS2[@]}" elif [ "$NOTIFY_WHAT" == "HOST" ]; then if [ "$NOTIFY_HOSTSTATETYPE" == "HARD" ]; then HOSTSTATETYPE=0 else HOSTSTATETYPE=1 fi #Passing the arguments into a seperate variable, then passing to command as an Array (otherwise some variables weren't escaping properly) ARGS1=(-v 2c -c public 62.239.184.46 '' NAGIOS-NOTIFY-MIB::nHostEvent nHostname s "$NOTIFY_HOSTNAME" nHostStateID i $NOTIFY_HOSTSTATEID nHostStateType i $HOSTSTATETYPE nHostAttempt i $NOTIFY_HOSTATTEMPT nHostDurationSec i $NOTIFY_HOSTDURATIONSEC nHostGroupName s "$NOTIFY_HOSTGROUPNAME" nHostLastCheck i $NOTIFY_LASTHOSTCHECK nHostLastChange i $NOTIFY_LASTHOSTSTATECHANGE nHostOutput s "$NOTIFY_HOSTOUTPUT" nHostAlias s "AUTOCLARIFY: $NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2") ARGS2=(-v 2c -c public 62.239.187.23 '' NAGIOS-NOTIFY-MIB::nHostEvent nHostname s "$NOTIFY_HOSTNAME" nHostStateID i $NOTIFY_HOSTSTATEID nHostStateType i $HOSTSTATETYPE nHostAttempt i $NOTIFY_HOSTATTEMPT nHostDurationSec i $NOTIFY_HOSTDURATIONSEC nHostGroupName s "$NOTIFY_HOSTGROUPNAME" nHostLastCheck i $NOTIFY_LASTHOSTCHECK nHostLastChange i $NOTIFY_LASTHOSTSTATECHANGE nHostOutput s "$NOTIFY_HOSTOUTPUT" nHostAlias s "AUTOCLARIFY: $NOTIFY_PARAMETER_1:$NOTIFY_PARAMETER_2") /usr/bin/snmptrap "${ARGS1[@]}" /usr/bin/snmptrap "${ARGS2[@]}" echo "${ARGS1[@]}" >> /tmp/logout else echo "ERROR: Invalid Check Type Passed" >> /tmp/logout ********************************************************************************
  • 3. ******************************************************************************** ************** 1ambchops F[k70Ux! blt11127001 10.54.148.54 E2ESlave1 b6&D9vq! root password: F[k70Ux! ****************************** 10.54.148.55 $cp -r ruby rubybackup ****************************** root password: muD9$5!G there might be an unpacked version of Ruby in /tmp as root run gem list wget https://rubygems.org/gems/net-ssh For Current net-ssh releases require Ruby 2.0 or later,So anyhow we have to install Ruby 2.0 ***************************** 10.54.148.55 su - e2eslave1 /usr/local/lib/ruby/gems/2.1.0 /usr/lib/ruby/gems/2.1.0/gems/chef-11.12.8/spec/unit/knife/client_create_spec.rb /usr/bin/ruby [root@blt11127001 usr]# cd uname -a bash: cd: uname: No such file or directory [root@blt11127001 usr]# uname -a Linux blt11127001 2.6.39-400.24.1.el6uek.x86_64 #1 SMP Wed May 15 11:46:52 PDT 2013 x86_64 x86_64 x86_64 GNU/Linux [root@blt11127001 usr]# [root@blt11127001 usr]# [root@blt11127001 usr]# [root@blt11127001 usr]# ruby -v ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux] [root@blt11127001 usr]# [root@blt11127001 usr]# [root@blt11127001 usr]# [root@blt11127001 gems]# gem install chef-helpers ERROR: http://rubygems.org/ does not appear to be a repository ERROR: Could not find a valid gem 'chef-helpers' (>= 0) in any repository
  • 4. [root@blt11127001 gems]# This may be automatically included in the Chef build in the future, but at the moment is still a manual step. Due to the new way we monitor Windows Services, we connect via SSH and use a small Netcat EXE to connect to the Check_MK Service locally. Unfortunately using the standard SSH Commands using this method seems to return a "chunked" response, where half the output of the agent doesn't get sent over correctly. The solution to this was to wrap up the Datasoruce call into a Ruby script, which waits until the entire response is recieved before passing it on. The script has also been extended to query any kind of OS by passing the IP + OS into the script. It should be placed in the OMD Sites Home Directory, and test that the Site User can call it correctly. It is available on SVN in the Chef Repo (under Misc) /var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checkman/.svn /var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checks/.svn /var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/pnp-templates/.svn /var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checkman/.svn /var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checks/.svn /var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_pnptemplates/.svn Example to wget: /var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checkman/.svn /var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/checks/.svn /var/chef/backup/opt/omd/sites/e2eslave1/local/share/check_mk/pnp-templates/.svn /var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checkman/.svn /var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_checks/.svn /var/chef/cache/cookbooks/Nagios-OMD/files/default/Base/extra_pnptemplates/.svn