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.

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,


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.