17
Installation of Centreon-Nagios-SAP-Plugins on RHEL5 Installation of Centreon-Nagios-SAP-Plugins on RHEL5 Applies to SAP ERP 2005 Redhat RHEL 5 on x86_64 Systems Summary This paper describes the steps to install a monitoring solution based on Nagios. SAP CCMS monitors can be uploaded and monitored from within this application. Author(s): Pascal Bombardier Company: BULL Created on: 30 October 2008 Author Bio Pascal Bombardier has 10 years of experience in ERP consulting, integration and development. His competences ranges from Operating systems to ERP software, from functional analysis to implementation and development. He is working for BULL company and currently joined the SAP Linuxlab as a hardware partner, where he certifies SAP software components on Bull hardware. SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2007 SAP AG 1

Nagios SAP

Embed Size (px)

Citation preview

Page 1: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Applies toSAP ERP 2005

Redhat RHEL 5 on x86_64 Systems

SummaryThis paper describes the steps to install a monitoring solution based on Nagios.

SAP CCMS monitors can be uploaded and monitored from within this application.

Author(s): Pascal Bombardier

Company: BULL

Created on: 30 October 2008

Author BioPascal Bombardier has 10 years of experience in ERP consulting, integration and development. His competences ranges from Operating systems to ERP software, from functional analysis to implementation and development. He is working for BULL company and currently joined the SAP Linuxlab as a hardware partner, where he certifies SAP software components on Bull hardware.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 1

Page 2: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Table of Contents1.Nagios Pre-requisites.....................................................................................................................................3

2.Nagios installation..........................................................................................................................................3

3.Centreon Pre-requisites.................................................................................................................................4

4.Centreon Installation......................................................................................................................................4

5.SAP plugins compilation................................................................................................................................5

6.Configuration Example...................................................................................................................................6

7.Application Views...........................................................................................................................................7

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 2

Page 3: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

1.Nagios Pre-requisites

Check that the following packages are installed :yum install httpdyum install gccyum install glibc glibc-commonyum install gd gd-devel

Disable SELinux (permissive mode)

2.Nagios installation

Nagios QuickStarthttp://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html

Create nagios account/usr/sbin/useradd -m nagiospasswd nagios/usr/sbin/groupadd nagcmd/usr/sbin/usermod -G nagcmd nagios/usr/sbin/usermod -G nagcmd apache

Install Nagios from sourcetar xvf nagios-3.0.4.tar.gzcd nagios-3.0.4./configure --with-command-group=nagcmdmake allmake installmake install-initmake install-configmake install-commandmode

Configure the administrator mail addressvi /usr/local/nagios/etc/objects/contacts.cfg

Finish Nagios installationmake install-webconfhtpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadminservice httpd restart

Install the Nagios pluginstar xzf nagios-plugins-1.4.13.tar.gzcd nagios-plugins-1.4.13./configure --with-nagios-user=nagios --with-nagios-group=nagiosmakemake install

Check Nagios configuration/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgComment line 551 (#time_change_threshold=)

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 3

Page 4: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Install and start Nagios servicechkconfig --add nagioschkconfig nagios onservice nagios start

3.Centreon Pre-requisites

Install rrdtool from EPEL websitewget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpmrpm -Uvh epel-release-5-3.noarch.rpmyum install rrdtool

Install php – mysqlyum install mysql-serveryum install php php-mysql php-pear php-snmp php-posix php-gd php-ldapyum install libpng libpng-devel perl-Config-IniFiles perl-Crypt-DES perl-Digest-HMAC perl-Digest-SHA1 perl-GD perl-IO-Socket-INET6 perl-Net-SNMP rrdtool-perl perl-Socket6

Start Mysqlchkconfig mysqld onservice mysqld start

4.Centreon Installationtar xvf centreon-1.4.2.7.tar.gz./install.sh...Where is installed RRD perl modules [RRDs.pm] ?/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi

Goto http://SERVER/centreon/php pear extensions failed

Setup the proxypear config-set http_proxy "http://proxy:8080"

Copy paste the command line from the browser to a shellpear install -o -f --alldeps DB DB_DataObject DB_DataObject_FormBuilder MDB2 Date Numbers_Roman Numbers_Words HTML_Common HTML_QuickForm HTML_QuickForm_advmultiselect HTML_Table Auth_SASL HTTP Image_Canvas Image_Color Image_Graph Image_GraphViz Mail Mail_Mime Net_SMTP Net_Socket Net_Traceroute Net_Ping Validate SOAP

Click on “Recheck”, all pear extensions should be OK.

Enter Centreon Database Name : centreon

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 4

Page 5: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Enter Centreon Data Storage Database Name : centstorage

Upload the Nagios configuration files from the server “/usr/local/nagios/etc” to the client PCnagios.cfgcgi.cfgresource.cfgobjects/*

In Centreon, goto “Configuration / Nagios / Import” and upload the nagios.cfg, cgi.cfg and resource.cfg files

Restarting Nagios from Centreon does not work# visudo

Comment the following line#Defaults requiretty

Configure service performance collection in nagios.cfgIn Centreon, goto “Configuration / Nagios / Nagios CFG” and setPerformance Data Processing Option YesService Performance Data Processing Command process-service-perfdataService Performance Data File /usr/local/nagios/var/service-perfdata

Start the ODS databasechkconfig –add odschkconfig ods onservice ods start

5.SAP plugins compilation

Get the following filessap-ccms-plugin-0.7.3.tar.gz

http://sourceforge.net/projects/nagios-sap-ccms/RFC_14-10004427_700NUC.SAR

http://service.sap.com/ Download / RFCSDK / 700 / Non-Unicode / x86_64sap_ccms.patch.txt

http://www.nagios-portal.org/wbb/index.php?page=Thread&postID=81533

# 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_monicp: overwrite `sap-ccms-plugin-0.7.3/src/sap_moni/librfc.a'? y# patch -p0 < sap_ccms.patch.txtpatching file sap-ccms-plugin-0.7.3/src/Makefilepatching file sap-ccms-plugin-0.7.3/src/sap_moni/Makefile# cd sap-ccms-plugin-0.7.3/src# vi check_sap_cons.c...

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 5

Page 6: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

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

Installation# cp sap_moni.so /lib64# 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

6.Configuration Example

Adjust login.cfg to login to the systems[LOGIN_BUL]LOGIN=-d BUL -u sap* -p passwd -h ls3023 -s 00

Adjust agents.cfg to monitor the required indicator[TEMPLATE_100]MONI_SET_NAME="SAP CCMS Monitor Templates"MONI_NAME="Dialog Overview"PATTERN_0="*ResponseTime"

[TEMPLATE_105]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"

[TEMPLATE_200]MONI_SET_NAME="SAP CCMS Monitor Templates"MONI_NAME="Database"PATTERN_0="*Fullest tablespace"

[TEMPLATE_210]MONI_SET_NAME="SAP CCMS Monitor Templates"MONI_NAME="Entire System"PATTERN_0="*DBRequestTime"

[TEMPLATE_300]MONI_SET_NAME="SAP CCMS Monitor Templates"MONI_NAME="Operating System"PATTERN_0="*5minLoadAverage"

[TEMPLATE_999]MONI_SET_NAME="SAP CCMS Monitor Templates"

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 6

Page 7: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

MONI_NAME="Entire System"PATTERN_0="*"

7.Application Views

Welcome screen

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 7

Page 8: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Service View

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 8

Page 9: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Hosts View

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 9

Page 10: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Reporting Screen

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 10

Page 11: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Host Graphics

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 11

Page 12: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Host Graphics with SAP Monitors

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 12

Page 13: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Services Configuration – Main View

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 13

Page 14: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Service Configuration – Detail View

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 14

Page 15: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Generate Nagios Configuration

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 15

Page 16: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Related ContentPlease include at least three references to SDN documents or web pages.

SAP on Linux

• https://www.sdn.sap.com/irj/sdn/linux

Supported Platforms

• https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/792dd957-0d01-0010-319b- e1211e5c66b0

SAP on Linux Forum

• https://www.sdn.sap.com/irj/sdn/forum?forumID=189

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 16

Page 17: Nagios SAP

Installation of Centreon-Nagios-SAP-Plugins on RHEL5

Disclaimer and Liability NoticeThis document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2007 SAP AG 17