User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 391,744 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,168 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 510 | Replies: 1
Reply
Join Date: Nov 2007
Location: Anacortes, WA (Hamburg, Germany)
Posts: 39
Reputation: geofoxer is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
geofoxer's Avatar
geofoxer geofoxer is offline Offline
Light Poster

writing a script for nagios checks...

  #1  
May 23rd, 2008
Hello all,

I am not at all by no means a good scripter, I just started last week... I am using Nagios and need to write a script using wget to pull webpages and test the response time. I need to write a script that pull the response time from wget and have the scpript return a value 0-4 (0=ok, 1=warning, and 2-4= critical), which will allow nagios send out notifications depending on the number returned from the script when nagios runs the service check. I am not sure how to start the script as I am new to this. I have written a shell script using wget already that pulls the page and places the results to an output file that i run from command line. I have gotten that far, but as far as setting variables, and other checks and commands for running the script is where I'm getting confused. I already know how to use the script for the service check in nagios, it is just the script that I need.

I would just like to be placed in the right direction as to where I should start writing this shell script. I want to learn how write shell script, so this would be one of my first major scripts. Any help or suggestions would be greatly appreciated!!!

Thanks ahead of time for the help.
Computers are like air conditioners. Both stop working, if you open windows.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 256
Reputation: eggi is on a distinguished road 
Rep Power: 1
Solved Threads: 26
eggi eggi is offline Offline
Posting Whiz in Training

Re: writing a script for nagios checks...

  #2  
May 23rd, 2008
Hey There,

You should be able to modify the polling script that comes with nagios. Other than that, if you wouldn't mind posting your code and notate where you want to set variables, etc, I'd be glad to help if I can.

Here's a link to a good Bash Tutorial to get you started learning shell scripting

Best wishes,

Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Shell Scripting Marketplace
Thread Tools Display Modes

Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 4:06 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC