In this tutorial we will show you how to monitor 3 of the major ports in SAP, which are: 3200, 3300 and 3600.
We assume that you have installed two virtual machines, one with MiniSAP and another one with CentOS Linux and Nagios Core:
- At least MiniSAP 7.0 onwards on Windows 2003 Server or XP Professional SP2.
- Nagios Core 3 on CentOS 5.8
NOTE: You can use Nagios Core 3 on any other Linux distribution, in case of not knowing how to install Nagios Core, please see previous posts on how to do it.
Steps to follow on our SAP Server:
1. We install the Nagios Agent (NSClient++) on our MiniSAP server. Double-click on the installation icon.
2. It will show us a screen like this:
We make click on the Next button.
3. On the next screen, mark for accepting the terms, and then make click on the Next button.
4. On the next screen, we make click on the Next button.
5. When we install for the first time the agent on our windows machine, it will create a new configuration file.
Now we make click on the Next button.
6. On the next screen, it will ask us the ip address of our Nagios Server, the password for authenticating our Nagios server. Note: Not the password for login in on Linux, and below we choose the plugins that we’ll use, we have the check_nt plugin and check_nrpe too. Now with all the information completed on the screen, we make click on the Next button.
7. Now, on the next screen we make click on the install button.
8. From now, the agent will be installed.
9. As last step, we mark the Start service option.
Now, in our SAP machine, we should go to the path C:\Program Files\NSClient++\ , in this path there is a file named NSC.ini , in this file we will enable the NRPE plugin.
1. Within the file, look for the following lines, and change the values as shown below:
a. Under [NRPE] tag, look for ;port=5666 / replace for port=5666
b. Under [NRPE] tag, look for ;command_timeout=60 / replace for command_timeout=60
c. Under [NRPE] tag, look for ;allow_arguments=0 / replace for allow_arguments=1
Save the file, and then we go to our Nagios server and let’s execute the following line in order to confirm that all be OK. .
[root@nagioscorelab3 objects]# /usr/local/nagios/libexec/check_nrpe -H 192.168.111.200
We should obtain a result similar to:
I (0.3.9.327 2011-08-16) seem to be doing fine…
Our SAP system it should be running. From the command line of our Nagios server, we can test the ports that we want to monitor, as mentioned before: 3200, 3300 and 3600.
Execute from the command line only the bold text:
[root@nagioscorelab3 objects]# /usr/local/nagios/libexec/check_tcp -H 192.168.111.200 -p 3200
TCP OK – 0.025 second response time on port 3200|time=0.024896s;;;0.000000;10.000000
[root@nagioscorelab3 objects]# /usr/local/nagios/libexec/check_tcp -H 192.168.111.200 -p 3300
TCP OK – 0.112 second response time on port 3300|time=0.111549s;;;0.000000;10.000000
[root@nagioscorelab3 objects]# /usr/local/nagios/libexec/check_tcp -H 192.168.111.200 -p 3600
TCP OK – 0.063 second response time on port 3600|time=0.063113s;;;0.000000;10.000000
These results indicate that from our Nagios server can listen perfectly SAP server ports.
In the path /usr/local/nagios/etc/objects exists a file named commands.cfg, add the following lines at the end of the file:
# ‘check_nrpe’ command definition
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$
Here we define the command check_nrpe for later use. After adding the lines above, reload nagios service, just run the following from the command line:
service nagios reload
In the same path mentioned before /usr/local/nagios/etc/objects there is another file named windows.cfg, within this file we’re going to define our SAP server, add these lines, preferably under your windows servers are defined:
use windows-server ;
host_name laboratorio17 ; hostname of your sap server
alias SAP Server; a description of our server
address 192.168.111.200 ; poner la ip de su servidor sap
Even we’ve configured the NRPE plugin for monitoring on this tutorial, we will use it later.
There are 3 major ports on SAP, they are: 3200, 3300 and 3600. A short description of them:
Port 3200 – SAP Dispatcher, its range is from 3200 to 3299.
Port 3300 – Gateway, its range is from 3300 to 3399.
Port 3600 – Message Server, its range is from 3600 to 3699.
The main goal of this tutorial is to monitor major SAP ports, after we have defined our SAP server in the windows.cfg file, in that file we will proceed to define the services for monitoring the ports.
# Port 3200
service_description SAP Dispatcher 3200
# Port 3300
service_description SAP Gateway 3300
# Port 3200
service_description Message Server 3600
After having everything defined, we reload the nagios service, and now our monitored ports should appear on our Nagios Web Interface. In the same way, we can use this procedure to monitor others ports like 1521 for the oracle database, and 1433 for the Microsoft SQL Server, and so on.