Skip to content

Commit e1e053c

Browse files
committed
add doc for check_sap_health
1 parent 4df9eae commit e1e053c

File tree

5 files changed

+381
-0
lines changed

5 files changed

+381
-0
lines changed
Lines changed: 381 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,381 @@
1+
---
2+
title: check_sap_health
3+
tags:
4+
- plugins
5+
- check_sap_health
6+
- sap
7+
- monitoring
8+
---
9+
10+
## Description
11+
12+
check_sap_health is a plugin designed to monitor SAP NetWeaver instances. It was developed as an easily extensible tool to monitor both technical parameters from the CCMS (Computing Center Management System) as well as business-related facts via RFC/BAPI.
13+
14+
The plugin communicates either with a Solution Manager or directly with application servers. Monitoring of SAP load balancing is also possible by connecting to the message server of a central instance.
15+
16+
With check_sap_health it is possible to monitor:
17+
- CCMS metrics (using SAP's own thresholds or defining custom thresholds)
18+
- Background jobs (duration as well as exit status)
19+
- Short dumps and failed updates
20+
- Process counts and workload analysis
21+
- IDoc status verification
22+
23+
A highlight of this plugin is its simple API which allows users to write small extensions to monitor individual business logic using the RFC/BAPI interface.
24+
25+
## Installation
26+
27+
The plugin requires the SAP NetWeaver RFC SDK and the Perl module `sapnwrfc`. In OMD, the plugin is already included; only the SDK and its dependencies need to be installed separately.
28+
29+
### Prerequisites
30+
31+
1. **SAP NetWeaver RFC SDK**: Download from SAP Service Marketplace
32+
2. **SAP Cryptographic Library**: Required for SNC (Secure Network Communication)
33+
3. **Perl module sapnwrfc**: Available from https://github.com/lausser/perl-sapnwrfc
34+
35+
### Installation Steps
36+
37+
1. Download the NW RFC SDK from SAP
38+
2. Extract using SAPCAR tool
39+
3. Clone and install the Perl module:
40+
```bash
41+
git clone https://github.com/lausser/perl-sapnwrfc.git
42+
cd perl-sapnwrfc
43+
perl Makefile.PL --source /path/to/nwrfcsdk
44+
make
45+
make install
46+
```
47+
4. Copy the shared libraries to your OMD site's library directory
48+
49+
For detailed SNC setup instructions, see our blog post: [Using check_sap_health with SNC](/blog/insights/check-sap-health-snc/)
50+
51+
## Command Line Parameters
52+
53+
### Connection Parameters
54+
55+
* **\--hostname** / **\--ashost**
56+
The hostname or IP address of the SAP application server.
57+
58+
* **\--sysnr**
59+
The SAP system number (instance number).
60+
61+
* **\--username**
62+
The SAP user for RFC connection.
63+
64+
* **\--password**
65+
Password of the SAP user.
66+
67+
* **\--client**
68+
The SAP client number. Default: 001
69+
70+
* **\--lang**
71+
The language for connection. Default: EN
72+
73+
* **\--mshost**
74+
The message server hostname (for load balancing).
75+
76+
* **\--msserv**
77+
The message server port.
78+
79+
* **\--r3name**
80+
The SAP system ID (SID) when connecting via message server.
81+
82+
* **\--saprouter**
83+
SAP Router connection string (e.g., `/H/router.example.com`). Routes the connection through an SAP Router, which can be combined with SNC for encrypted communication through a single gateway.
84+
85+
### Filtering Parameters
86+
87+
* **\--name**
88+
Filter for specific objects (usage depends on mode).
89+
90+
* **\--name2**
91+
Additional filter parameter for narrowing results.
92+
93+
* **\--name3**
94+
Third level filter parameter.
95+
96+
* **\--regexp**
97+
Treat name filters as regular expressions.
98+
99+
### Operational Parameters
100+
101+
* **\--mode**
102+
Specifies what the plugin should check. See "Modes" section below for available values.
103+
104+
* **\--lookback**
105+
Time window in seconds for historical data analysis.
106+
107+
* **\--separator**
108+
Separator character for MTE (Monitoring Tree Element) paths. Default: ->
109+
110+
* **\--mtelong**
111+
Output complete MTE paths in plugin output.
112+
113+
### Threshold Parameters
114+
115+
* **\--warning** / **\--warningx**
116+
Warning threshold. Use \--warningx to override SAP's default thresholds.
117+
118+
* **\--critical** / **\--criticalx**
119+
Critical threshold. Use \--criticalx to override SAP's default thresholds.
120+
121+
### Output Parameters
122+
123+
* **\--report** <short|long|html>
124+
Output format for the check results.
125+
126+
### SNC (Secure Network Communication) Parameters
127+
128+
* **\--snc**
129+
Enable SNC protocol for encrypted communication. Sets environment variable `SNC_MODE=1`.
130+
131+
* **\--secudir**
132+
Directory containing the `SAPSNCS.pse` file (Personal Security Environment).
133+
134+
* **\--snc-lib**
135+
Path to the `libsapcrypto.so` library. If not specified, the plugin searches `LD_LIBRARY_PATH`.
136+
137+
* **\--snc-myname**
138+
SNC name identifying the monitoring system (sets `SNC_MYNAME`).
139+
140+
* **\--snc-partnername**
141+
Distinguished Name (DN) of the SAP system's certificate (sets `SNC_PARTNERNAME`).
142+
143+
* **\--snc-qop**
144+
Quality of Protection level (sets `SNC_QOP`). Default: 3
145+
- 1 = Authentication only
146+
- 2 = Integrity protection
147+
- 3 = Privacy protection (encryption)
148+
- 8 = Use default protection
149+
- 9 = Maximum protection
150+
151+
### Extension Parameters
152+
153+
* **\--with-mymodules-dyn-dir**
154+
Directory path for custom extension modules.
155+
156+
## Modes
157+
158+
check_sap_health supports various modes for different monitoring tasks:
159+
160+
### Connection Testing
161+
162+
| Mode | Description |
163+
|------|-------------|
164+
| connection-time | Measures how long connection establishment and login take |
165+
166+
### CCMS Monitoring
167+
168+
| Mode | Description |
169+
|------|-------------|
170+
| list-ccms-monitor-sets | Lists all available CCMS monitor sets |
171+
| ccms-mte-check | Checks specific CCMS Monitoring Tree Elements |
172+
173+
### Short Dump Analysis
174+
175+
| Mode | Description |
176+
|------|-------------|
177+
| shortdumps-list | Lists all short dumps |
178+
| shortdumps-count | Counts short dumps within a time window |
179+
| shortdumps-recurrence | Monitors recurring short dumps |
180+
181+
#### Short Dumps Monitoring Examples
182+
183+
The plugin provides detailed monitoring of SAP short dumps with visual feedback in monitoring interfaces:
184+
185+
**Recurring Short Dumps Detection:**
186+
187+
![Short dumps recurrence monitoring](check_sap_health_shortdumps-recurrence-1.png)
188+
189+
*The plugin tracks short dump patterns and alerts on recurring issues*
190+
191+
![Short dumps recurrence detail view](check_sap_health_shortdumps-recurrence-2.png)
192+
193+
*Detailed popup showing short dump analysis and history*
194+
195+
**Short Dumps Count:**
196+
197+
![Short dumps count monitoring](check_sap_health_shortdumps-count-1.png)
198+
199+
*Count-based monitoring with configurable thresholds and time windows*
200+
201+
### Job Monitoring
202+
203+
| Mode | Description |
204+
|------|-------------|
205+
| list-jobs | Lists background jobs |
206+
| failed-jobs | Checks for failed background jobs |
207+
| exceeded-failed-jobs | Monitors jobs that exceeded their expected runtime |
208+
209+
### Process Monitoring
210+
211+
| Mode | Description |
212+
|------|-------------|
213+
| list-processes | Lists SAP work processes |
214+
| count-processes | Counts work processes by type |
215+
216+
### IDoc Monitoring
217+
218+
| Mode | Description |
219+
|------|-------------|
220+
| list-idocs | Lists IDocs |
221+
| failed-idocs | Checks for failed IDocs |
222+
223+
### System Analysis
224+
225+
| Mode | Description |
226+
|------|-------------|
227+
| failed-updates | Checks for failed update requests |
228+
| workload-overview | Analyzes system workload statistics |
229+
230+
## Extensions
231+
232+
check_sap_health can be extended with custom functionality through Perl modules. This allows you to monitor business-specific metrics and processes.
233+
234+
### Creating Custom Modules
235+
236+
1. Create a Perl module following the naming convention: `CheckSapHealth*.pm`
237+
2. Place the module in `$OMD_SITE/etc/check_sap_health/`
238+
3. The module must inherit from `Classes::SAP::Netweaver::Item`
239+
4. Use the `--with-mymodules-dyn-dir` parameter to specify the module directory
240+
241+
### Example Module Structure
242+
243+
```perl
244+
package CheckSapHealthCustom;
245+
246+
use strict;
247+
use base qw(Classes::SAP::Netweaver::Item);
248+
249+
sub init {
250+
my ($self) = @_;
251+
# Your initialization code
252+
}
253+
254+
sub nagios {
255+
my ($self) = @_;
256+
# Your check logic
257+
# Set $self->{nagios_level} and $self->{nagios_message}
258+
}
259+
260+
1;
261+
```
262+
263+
## Examples
264+
265+
### Basic Connection Test
266+
267+
```bash
268+
check_sap_health \
269+
--hostname sap.example.com \
270+
--sysnr 00 \
271+
--username nagios \
272+
--password secret \
273+
--client 100 \
274+
--mode connection-time
275+
```
276+
277+
### CCMS Monitoring with Filters
278+
279+
```bash
280+
check_sap_health \
281+
--hostname sap.example.com \
282+
--sysnr 00 \
283+
--username nagios \
284+
--password secret \
285+
--client 100 \
286+
--mode ccms-mte-check \
287+
--name "SAP CCMS Monitor Templates" \
288+
--name2 "Dialog Overview" \
289+
--name3 "ResponseTime" \
290+
--mtelong
291+
```
292+
293+
### Monitoring via Message Server (Load Balancing)
294+
295+
```bash
296+
check_sap_health \
297+
--mshost sap-msg.example.com \
298+
--msserv 3600 \
299+
--r3name PRD \
300+
--username nagios \
301+
--password secret \
302+
--client 100 \
303+
--mode workload-overview
304+
```
305+
306+
### Secure Connection with SNC
307+
308+
```bash
309+
check_sap_health \
310+
--hostname sap.example.com \
311+
--sysnr 00 \
312+
--username nagios \
313+
--password secret \
314+
--client 100 \
315+
--mode ccms-mte-check \
316+
--name "Dialog" \
317+
--snc \
318+
--secudir /omd/sites/mysite/etc/check_sap_health/sec \
319+
--snc-partnername "p:CN=SAP_PRD,O=Company,C=DE"
320+
```
321+
322+
### Using SAP Router
323+
324+
```bash
325+
check_sap_health \
326+
--saprouter "/H/router.example.com" \
327+
--hostname sap.example.com \
328+
--sysnr 00 \
329+
--username nagios \
330+
--password secret \
331+
--client 100 \
332+
--mode connection-time
333+
```
334+
335+
## Threshold Syntax
336+
337+
Thresholds follow the Nagios plugin development guidelines:
338+
339+
* `10` means "Alarm if > 10"
340+
* `10:` means "Alarm if < 10"
341+
* `10:20` means "Alarm if < 10 or > 20"
342+
* `@10:20` means "Alarm if between 10 and 20"
343+
344+
## Directory Layout in OMD
345+
346+
| Path | Description |
347+
|------|-------------|
348+
| `<site>/lib/nagios/plugins/` | Binary directory (provided by OMD Release) |
349+
| `<site>/local/lib/` | Library directory for SDK files |
350+
| `<site>/etc/check_sap_health/` | Configuration and extension modules |
351+
352+
## SAP Permissions
353+
354+
The SAP user used for monitoring requires specific authorizations. The minimal authorization profile should include:
355+
356+
* RFC function groups for CCMS access
357+
* Read access to background job tables
358+
* Access to system monitoring functions
359+
360+
![SAP Permissions Diagram](check_sap_health-permissions.png)
361+
362+
*Required SAP authorizations and access levels for monitoring operations*
363+
364+
Consult your SAP Basis team to create an appropriate monitoring user with restricted permissions. The diagram above shows the complete authorization hierarchy needed for full plugin functionality.
365+
366+
## Resources
367+
368+
* **GitHub Repository**: https://github.com/lausser/check_sap_health
369+
* **Changelog**: https://github.com/lausser/check_sap_health/blob/master/ChangeLog
370+
* **Perl Module (sapnwrfc)**: https://github.com/lausser/perl-sapnwrfc
371+
372+
## Author & License
373+
374+
**Author**: Gerhard Laußer, ConSol Labs
375+
376+
**License**: GNU General Public License
377+
378+
## See Also
379+
380+
* [Using check_sap_health with SNC](/blog/insights/check-sap-health-snc/) - Detailed guide for setting up SNC
381+
* [OMD Packages](/docs/omd/packages/) - Overview of included monitoring plugins
37.5 KB
Loading
15.1 KB
Loading
9.73 KB
Loading
11.7 KB
Loading

0 commit comments

Comments
 (0)