Sie sind auf Seite 1von 8

Rajesh Sharma rajesharichwal@rediffmail.com 25-03-2010 ver 1.

How to configure Nagios to monitor SAP

Purpose for creating this document CCMS is integrated part of SAP, which provide the low level monitoring of SAP servers including their hardware and software. It monitor almost all the the things in SAP. Nagios is an open source tool working as an Enterprise monitoring server for data center. It give the good interface to administrators and have very good alerting options through mail or sms according to the escalation matrix. We can take predefine remedies action on affected service. We can send alert through SAP also. But I do this through nagios because I wants to do the centerlized monitoring and making the Nagios as an complete Enterprise Monitoring solution for Data center. Table of contents 1. Nagios installation 1.1 Pre-requisites 1.2 Installation of nagios and nagios plugins 2. Installation of SAP Plugins 3. Configuration of SAP MON 3.1 Configuration of login.cfg 3.2 Configuration of Agent.cfg 4. Configure the SAP server for monitoring 5. Configure nagios of SAP monitoring 5.1 Checking the sap monitoring through commands 5.2 Make changes in nagios configuration 1. Nagios Installation You can get the complete installation process for how to install nagios on centos/redhat http://nagios.sourceforge.net/docs/3_0/toc.html. I recommend you to first go through the nagios official documentation for installation or you can follow my documentation for this. I am using CentOS 4.5 for nagios installation. 1.1 Pre-requisites Check that the following packages are installed : yum install httpd yum install gcc yum install glibc glibc-common yum install gd gd-devel

Disable SELinux (permissive mode) 1.2. installation Nagios QuickStart http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html Create nagios account /usr/sbin/useradd -m nagios passwd nagios /usr/sbin/groupadd nagcmd /usr/sbin/usermod -G nagcmd nagios /usr/sbin/usermod -G nagcmd apache Install Nagios from source Download the nagios from "www.nagios.org" tar xvf nagios-3.0.4.tar.gz cd nagios-3.0.4 ./configure --with-command-group=nagcmd make all make install make install-init make install-config make install-commandmode Configure the administrator mail address vi /usr/local/nagios/etc/objects/contacts.cfg Finish Nagios installation make install-webconf htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin service httpd restart Install the Nagios plugins tar xzf nagios-plugins-1.4.13.tar.gz cd nagios-plugins-1.4.13 ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install 3.Installation of SAP plugins Down load the sap-ccms plugins from the sourceforge.net. Get the following files sap-ccms-plugin-0.7.3.tar.gz from http://sourceforge.net/projects/nagios-sap-ccms/files/nagios-sap-ccms/0.8/sap-ccms-plugin-

0.8.tar.bz2/download Now you have to download the sap rfcsdk from the SAP's official site. http://service.sap.com/ Download / RFCSDK / 700 / Non-Unicode / x86_64 sap_ccms.patch.txt For more information you can visit this site http://www.nagios-portal.org/wbb/index.php?page=Thread&postID=81533 Now untar the downloaded files in new directory # mkdir ccms_sap # cd ccms_sap # tar xvf sap-ccms-plugin-0.7.3.tar.gz # sapcar -xvf RFC_14-10004427_700NUC.SAR # cp rfcsdk/lib/librfc.a sap-ccms-plugin-0.7.3/src/sap_moni cp: overwrite `sap-ccms-plugin-0.7.3/src/sap_moni/librfc.a'? y # patch -p0 < sap_ccms.patch.txt patching file sap-ccms-plugin-0.7.3/src/Makefile patching file sap-ccms-plugin-0.7.3/src/sap_moni/Makefile # cd sap-ccms-plugin-0.7.3/src # vi check_sap_cons.c printf("%s %s %s %s %s | %s=%s\n",nodes[j].Mtsysid, nodes[j].Mtmcname, nodes[j].Objectname, nodes[j].Mtnameshrt, nodes[j].currentValue, nodes[j].Mtnameshrt, nodes[j].currentValue); # make # cp sap_moni.so /lib # cp check_sap check_sap_cons check_sap_instance check_sap_instance_cons check_sap_multiple check_sap_mult_no_thr check_sap_system check_sap_system_cons /usr/local/nagios/libexec/ # chown apache:nagios /usr/local/nagios/libexec/* # cp -a config /etc/sapmon 4 Configuration of Sap mon 4.1 Configuration of login.cfg Adjust login.cfg to login to the systems Let say you have a SAP server with the name DEV and 000 client on this [LOGIN_DEV] LOGIN=-d DEV -u ccms -p ccms -h ls3023 -s 00 4.2 Configuration of agents.cfg Adjust agents.cfg to monitor the required indicator

[TEMPLATE_40] MONI_SET_NAME="SAP CCMS Monitor Templates" MONI_NAME="Dialog Overview" PATTERN_0="*ResponseTime" [TEMPLATE_41] MONI_SET_NAME="SAP CCMS Monitor Templates" MONI_NAME="Dialog Overview" PATTERN_0="*UsersLoggedIn" [TEMPLATE_110] MONI_SET_NAME="SAP CCMS Monitor Templates" MONI_NAME="Entire System" PATTERN_0="*EsAct" 5. Configure the SAP sever for monitoring Now make changes on sap server side, so that nagios can talk to sap to get the data. Login into sap on any client I am using 000 because its not count for users ids. Now run the Tcode su01 Create a new user ccms Give the initial password Now run the Tcode PFCG create a new profile z_sap_ccms now go to Authorization and manual add the three objects

Now give the authorization to in newly created objects.

Now Generate and save the the Role and assign this role to the use which we created ccms .

6. Configure nagios for SAP Monitoring 6.1 checking the sap monitoring through commands [root@localhost ~]# su nagios [nagios@localhost ~]$ cd /usr/local/nagios/libexec/ Now run the command and check the output [nagios@localhost libexec]$ ./check_sap_cons 40 DEV DEV hostname_DEV_00 Dialog ResponseTime 980 msec

If you get the desired output then configure the nagios for host, service, command, contact, contact groups. 6.2 Make changes in nagios configuration define host{ use generic-host ; Name of host template to use host_name DEV alias DEV address 192.168.1.6 max_check_attempts 5 notification_interval 120 notification_period 24x7 notification_options d,u,r contact_groups admins } define contact{ name generic-contact ; The name of this contact template service_notification_period 24x7 ; service notifications can be sent anytime host_notification_period 24x7 ; host notifications can be sent anytime service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events service_notification_commands notify-service-by-email ; send service notifications via email host_notification_commands notify-host-by-email ; send host notifications via email register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE! } define contactgroup{ contactgroup_name admins alias Administrators members admin }

define service{ use

generic-service

; Name of service template to use

host_name service_description is_volatile check_period max_check_attempts normal_check_interval retry_check_interval contact_groups notification_interval notification_period notification_options check_command }

DEV-Server Response time 0 24x7 3 180 1 admins 180 24x7 w,u,c,r check_sap_cons! 40! DEV!

# 'SAP monitoring' command definition define command { command_name check_sap command_line $USER1$/check_sap $ARG1$ $ARG2$ }

# 'SAP Monitoring' command definition # 'SAP monitoring' command definition define command { command_name check_sap_multiple command_line $USER1$/check_sap_multiple $ARG1$ $ARG2$ } # 'SAP Monitoring' command definition # 'SAP monitoring' command definition define command { command_name check_sap_system command_line $USER1$/check_sap_system $ARG1$ $ARG2$ } # 'SAP Monitoring' command definition # 'SAP monitoring' command definition define command { command_name check_sap_instance command_line $USER1$/check_sap_instance $ARG1$ $ARG2$ } define command { command_name check_sap_cons command_line $USER1$/check_sap_cons $ARG1$ $ARG2$ } define command {

command_name check_sap_mult_no_thr command_line $USER1$/check_sap_mult_no_thr $ARG1$ $ARG2$ } Now check the nagios configurations with /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg After successful completion reload or restart the nagios service now we will be able to see the SAP servers in your nagios web page with complete monitoring as shown in below.

Das könnte Ihnen auch gefallen