•
•
•
•
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 425,938 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 1,625 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: Programming Forums
Views: 567 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Location: Anacortes, WA (Hamburg, Germany)
Posts: 39
Reputation:
Rep Power: 1
Solved Threads: 0
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.
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.
•
•
Join Date: Oct 2007
Posts: 273
Reputation:
Rep Power: 1
Solved Threads: 26
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
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!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the Shell Scripting Forum
- Previous Thread: backup directory
- Next Thread: Variable check


Linear Mode