check_sap_hostctrl

SAP CCMS Monitoring -> ABAP/JAVA/TREX

Check SAP-Systems CCMS on ABAP, JAVA and TREX, Workload-SAP-Processes, ICM Connections

Workload of Dialog, Batch, UPD, ENQ Processes Processes This check don´t use a login to the sap-system. I use the sapcontrol binarie to check the ccms output from sap. The sapcontrol is installed on every sap-system with a new sap-kernel.

The tool is installed on the following path: /usr/sap/hostctrl/exe

You can use the sapcontrol for many things. Start,stop, monitoring and so on..... The check can monitor

sap-ccms

# Utilization of the abap-processes ( Dialog, Batch, Spool, Update, Update2, Enqueu ).
# SAP-ICM Connections

I have to methodes to use this check.

1. You install the hostctrl on the icinga-system.
   Use the sapcontrol-binarie directly from icinga-system without ssh and sudo.
   That is the preferred way!!
   The sapcontrol-binarie is an component of the sap hostcontrol-system. 
   The newer sap-system must use the hostcontrol-service with sapstartsrv.

    Syntax to test the connection from icinga-sapcontrol to remote-system with:
    //sapcontrol -host  -nr  -function GetVersionInfo

    Attention: on the newer sap-kernel releases beginning 7.30 you have a new
    security-featur of sapcontrol.
    Only the adm can use the sapcontrol binarie or you must allow another user
    to use the sapcontrol binarie

    Errormessage: FAIL: HTTP error, HTTP/1.1 401 Unauthorized
    //sapcontrol -host  -nr  -function GetVersionInfo -user  

    If you don´t want use the adm to check the sap-system. 
    You must define in the sap-profile another user.
    Please greate in /sapmnt//profile/_DVEBMGS_ a new value ->    
    service/admin_users = 
    To activate the the parameter you must restart the sapstartsrv process
    with the following command:
    //sapcontrol -nr 62 -function RestartService 
        -> the command only restart the sapstartsrv not the sap-system

2. You can use check_by_ssh and the sapcontrol on the remote-machine.
   The binary use the account  to connect to the system.
   This is sap-standard!
   Configure the sudo command on the remote-machine.
   The check_plugin should only use with your nagios-user and check per ssh the remote-machine.

   This is the command ->
    sudo su - root -c /usr/sap/hostctrl/exe/sapcontrol

   The sudo-file on the remote-machine have this entry:
   %nagios  ALL=(ALL)       NOPASSWD: /bin/su - root -c /usr/sap/hostctrl/exe/sapcontrol -nr * -function GetAlertTree*

   Adv:     no software installation on the icinga-system
   DisAdv:  all sapchecks use a ssh-call

Manpage <<< check_sap_hostctrl >>>

Usage:

check_host_ctrl.pl -host &lt; HOSTNAME &gt; -sysnr &lt; SYSNR &gt; -meth &lt; sap|nag|ls|cons &gt; -&lt; obj|function &gt; &lt; MONITORING-OBJEKT &gt; -backend &lt; abap|java|trex|multi &gt; -w &lt; WARNING-LEVEL &gt; -c &lt; CRITICAL-LEVEL &gt; -t &lt; TIME_IN_SEC &gt; -sudo &lt; 0|1 &gt; -user &lt; user &gt; -pass &lt; password &gt;

Optionen:

-host: HOSTNAME

-sysnr: SAP-System-NR

-meth: &lt; sap|nag|ls|cons &gt;
    sap:    The alarmlevels are used from sap-ccms-methode ta:rz20. The SAP-LEVEL are GREEN, YELLOW, RED, GRAY.
    nag:    The alarmlevel warning or critical are used from nagios. This options are -w (warning) and -c (critical).
    ls:     List the monitoring tree with all objects.
    cons:   You can use other objects without ccms. For more information use sapcontrol -h.

-obj: &lt; MONITORING-OBJECT &gt;
    abap -&gt;
        Operating-System:
            Free Memory                 -&gt; Free Memory OS
            Paging\\Page_IN             -&gt; PageIn
            Paging\\Page_Out            -&gt; PageOut
            Swap_Space\\Percentage_Used -&gt; SWAP Space usage %

        SAP:
            Utilisation Granule Entries -&gt; DE: Sperrtabelle
            Gateway_CommAdmEnty         -&gt; DE: SAP Gateway Verbindungen
            PerformanceU1\\Utilisation  -&gt; Performance UPD1
            OS_Collector\\State         -&gt; OS Collector State
            CacheHits                   -&gt; CacheHits %
            CacheHitsMem                -&gt; CacheHitsMem %
            ResponseTime                -&gt; Dialog Response Time msec
            FrontendResponseTime        -&gt; Frontend Response Time msec
            UsersLoggedIn               -&gt; Number of Users logged in
            LDAP_RFC-01\\Status         -&gt; LDAP Connector 01 State           
            EM Used                     -&gt; Extended Memory Usage %
            R3RollUsed                  -&gt; Roll area usage %
            Shortdumps                  -&gt; ABAP Shortdumps st22. You should use with -obj: sap
            Shortdumps Frequency        -&gt; ABAP Shutdump frequenze
            deadlocks                   -&gt; deadlocks
            HostspoolListUsed           -&gt; Used Spool Numbers %
            SyslogFreq                  -&gt; Syslogfrequency %
            R3Syslog\\Security          -&gt; Syslog analysis scope: security messages
            R3Syslog\\CCMS              -&gt; Syslog analysis scope: ccms messages

        DB:
            DBRequestTime   -&gt; RequestTime
            SqlError        -&gt; SQL-Error

        Java -&gt;
            HTTPConnectionsCount            -&gt; dispatcher http connections
            Average response time           -&gt; msec. DE: durchschnittliche Antwortzeit
            UsedMemoryRate                  -&gt; Memory Usage
            UnsuccessfulLogonAttemptsCount  -&gt; Unsuccessful Logons
            CurrentHttpSessions             -&gt; act. http sessions

        Trex -&gt;
            Free Memory         -&gt; Free Memory \%
            IndexServer Memory  -&gt; Index Server Memory
            QueueServer Memory  -&gt; Queue Server Memory
            RfcServer Memory    -&gt; RFC Server Memory
            Build               -&gt; TREX Version
            Search Time         -&gt; Performance: Search Time
            Search Count        -&gt; Performance: Request per minute
            RFC Check           -&gt; RFC Connections to backend systems
            Index Status        -&gt; Index State
            Build               -&gt; TREX Version

-function: use this with -meth: cons
    ABAPGetWPTable      -&gt; Processtable of sap-system ( dia-proc, btc-proc, upd-proc, spo-proc, up2-proc )
    ICMGetConnectionList-&gt; Number if ICM Connections

-backend: Type of sap-backend system
    abap: abap-backend-system
    java: java-backend-system
    trex: trex-backend-system
    multi: multiline output for meth: cons

-w: warning-level

-c: critical Level

-t: plugin timeout, default: 30 sec.

-sudo: 1
    This parameter is optional. 
    If you set the parameter to 1 the icinga-system check with ssh and sudo command on remote-site

-user: &lt; user &gt;
    You can use this paramter for the sap-kernels newer then 7.21
-pass: &lt; password &gt;
    You can use this paramter for the sap-kernels newer then 7.21

Help:
    Error:
        GetAlertTree FAIL: NIECONN_REFUSED (Connection refused), NiRawConnect failed in plugin_fopen -&gt; The sap-system-nr is incorrect.

        FAIL: HTTP error, HTTP/1.1 401 Unauthorized -&gt; You use a new sap-kernel binarie (greater then 7.21)
        In this new version the sapstartsrv service have security features enabled.
        Set the paramter service/protectedwebmethods=NONE in the sap-instance profile
        NONE-&gt;sapstartsrv-security-features disabled
        For more information have a look at SAP-Note 927637. 
        Other solution, you can create a monitoring user in sap-profile! 

Others:

    Monitoring-Objects:
        If you want other monitoring objects from ccms, please use the following command
        to investigate which objects are available.
        /usr/sap/hostctrl/exe/sapcontrol -nr  -function GetAlertTree
        or
        check_host_ctrl.pl -host  -nr  -meth ls

Version: check_host_ctrl.pl -v

Syntax: check_host_ctrl.pl -host  -sysnr  -meth  -  -backend  -w  -c  -t 

    Examples:

        check_host_ctrl.pl -host  -sysnr 00 -meth ls
            List all montoring-objects from sap-system

        check_host_ctrl.pl -host  -sysnr 00 -meth ls -sudo 1
            List all monitoring-objects from backend, but use the sapcontrol binarie
            from backend-system with ssh connection and sudo command

        check_host_ctrl.pl -host  -sysnr 00 -meth sap -obj CacheHits -backend abap
            Output of sap-abap cachehits with alarmlevel from sap-ccms

        check_host_ctrl.pl -host  -sysnr 00 -meth nag -obj CacheHits -backend abap -w 60 -c 80
            Output of sap-abap cachehits with alarmlevel from nagios-system

        check_host_ctrl.pl -host  -sysnr 00 -meth cons -function ABAPGetWPTable -backend multi -w 80 -c 90
            Output of sap-processes, DIA-Usage, BTC-Usage, SPO-Usage, UPD-Usage, UP2-Usage

        check_host_ctrl.pl -host  -sysnr 00 -meth cons -function ABAPGetWPTable -backend multi -w 80 -c 90 -user  -pass 

            Output of sap-processes, DIA-Usage, BTC-Usage, SPO-Usage, UPD-Usage, UP2-Usage

Roadmap:

# ABAPReadSyslog -&gt; Syslog (TA:sm21)
# J2EEGetProcessList -&gt; J2EE-Processes running
# an so on...