Jump to content
Sign in to follow this  

AutoIT Script and Nagios: How to enable an echo answer?

Recommended Posts



i have a little script which does some tests and then return the results to nagios.

Nagios is waiting for an exit code to decide if a result status is ok, critical or in a warning state.

That works well.

But it is also possible that nagios receives a "echo" answer together with the exit code, so that you can see the answer in the nagios web interface.

Here is an example batch file:

@echo OK: Everything is going to be fine.
@exit 0

When a nagios check call this script, i receive a green "ok" answer with the text "Everythin is going to be fine."

My little test script looks like this:

$ip = IniRead ("scriptconfig.ini", "IP", "IP", "")
$check = ping ($ip)
if $check = 0 Then
    exit (2)
    exit (0)

You see, i get the correct error code but i don't know how to set an answer for nagios.

RunWait (@COMSPEC & " /c echo Ping ok") does not work.

I hope someone can help me.


Share this post

Link to post
Share on other sites

Hi SpecialK,

use a consolewrite() before your exit()

Just tested this out and works like a charm! :)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.