How to integrate Al’exa with monitoring systems As first step it is necessary to install the NSclient++ 0.3.9 on the Al'exa virtual machine by downloading it from https://www.nsclient.org/nscp/downloads NOTE: NSClient++ should not be registered as a service (because windows services cannot interact with the desktop and gui): The following components should be enabled: On the "Allowed hosts:" input box, add your Nagios server. In that way your Nagios server(s) will be able to communicate with the Al'exa vm. You can also add them later into the configuration file. Now, open the configuration file of the NSClient++ (named NSC.ini) and uncomment (if commented) the string CheckExternalScripts.dll: Increase the command timeout and allow external script argument: © Würth Phoenix S.r.l. & Alan Pipitone 1/4 You have to put the line allow_arguments=1 also under the [NRPE] section Insert the entry for the Al'exa Test Cases (into the External Scripts section): Of course you have to edit the Python folder and Al'exa test cases directory according to your environment. Now you have to create a shortcut with the following target: "C:\Program Files\NSClient++\nsclient++.exe" "/test"(Of course you have to edit the nsclient++ folder according to your environment) Put that shortcut into the startup folder of the account that will execute the testcases: That account should have the rights to run the NSClient++ and Al'exa Test Cases. In this way when you login into the virtual machine the NSClient++ will run automatically: © Würth Phoenix S.r.l. & Alan Pipitone 2/4 NOTE: you can set the option to minimize the NSClient++ console. So in this way, when you logon into the machine, the NSClient++ console will be minimized (and you'll have the desktop free). See below: If NSClient++ will not startup automatically then you should check the UAC settings. As you have seen, Al'exa needs an active Windows session in order to work properly. So you have to login into Windows with the same account that NSClient++ has into the startup folder. You will see the NSClient++ that starts automatically. If you lock the machine or logoff, then Al'exa will stop to work. Setup the Nagios Server You can use several methods to configure Nagios to contact the NSClient++. In this tutorial it is explained how to use the nrpe method. First of all you have to configure the commands for your service. So open the file commands.cfg and insert the following lines: © Würth Phoenix S.r.l. & Alan Pipitone 3/4 define command{ command_name check_alexa command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 600 -c check_alexa -a $ARG1$ } A timeout of 600 seconds is set for the nrpe command. Now you have to use the above command into the cfg file for the Al'exa machine. So, in that cfg file put the following lines: define service{ use host_name service_description check_command } insert-your-service-template insert-the-alexa-host-name insert-the-service-description check_alexa!your-remote-testcase-filename You can run only one test case at a time on the same machine. If you have to run more test cases on the same machine you have several options: for example you can configure one active service that executes in succession the testcases (as passive checks), you can also adjust the time periods of the checks and so on... An important note: I suggest you to set the Al'exa log level to error if you run it with Nagios, otherwise you will have soon a full hard drive. To do That just go to the log section of your test case(s): Click on the red arrow (on the left) and expand the code. Edit the line as follow: Log.Enable = True Log.DebugImages = False Log.Level = "error" © Würth Phoenix S.r.l. & Alan Pipitone 4/4
© Copyright 2024