Jump to content

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


Recommended Posts

Hello,

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", "14.14.14.14")
$check = ping ($ip)
if $check = 0 Then
    exit (2)
Else
    exit (0)
EndIf

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.

SpecialK

Link to comment
Share on other sites

  • 1 month later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...