In this article http://nagios.sourceforge.net/docs/3_0/eventhandlers.html#example they show how to get arguments from nagios to shell script. I have done this. Now in this article they show how to receive nagios parameters in .bat files. You can access nagios parameters like so:
(::echo 1: %1 2: %2 3: %3 4: %4)
In shell script I would access the variables like this: echo $1, echo $2 ect…
How do I access this variables in c# in .exe file?
It looks like Nagios just passes the arguments via command line. Assuming your C# project is just a console application, the command line arguments will be passed to
Main. So the following will print 3 arguments:Note, before retrieving the command line arguments make sure to check that the indices are valid.