In my articles Overly Long Outputs and Turning Off Performance Data Output I discuss shortened text outputs. However some basics about the subject matter are needed in order to fully understand these two articles

The first thing to know is that the plugin should provide data to the monitoring system that is is responsible for displaying this data. However, the plugin must deliver the data in such a way that the monitoring system can output the data appropriately depending on the use case.

Fundamentally, we have to differentiate between:

  • SERVCIEOUTPUT
  • LONGSERVICEOUTPUT
  • PERFDATEN

Example

Lets take a look at an example:

$ ./check_netapp_pro.pl Usage -H filer -o volume ...

The output for this command could look like this:

NETAPP_PRO USAGE CRITICAL - 62 volumes checked, 1 critical and 0 warning
No SVC-ACK relevant changes in reason.
vol_MSSQL_abcData: 274.9GiB
vol_n_IS7_sapdata: 267.5GiB
Store_SVMTest_abc: 112.5GiB
(...) 
|Store_SVMTest_aaa=39613349888B;1288490188800;1449551462400;0;1610612736000 vol_m_IS7_sapdata=120789544960B;214748364800;241591910400;0;268435456000 ...

This output can be arranged into:

SERVICEOUTPUT (up to the first newline):

NETAPP_PRO USAGE CRITICAL - 62 volumes checked, 1 critical and 0 warning

LONGSERVICEOUTPUT (from the first newline up to the pipe):

No SVC-ACK relevant changes in reason.
vol_MSSQL_abcData: 274.9GiB
vol_n_IS7_sapdata: 267.5GiB
Store_SVMTest_abc: 112.5GiB
... usw

PERFDATEN (everything after the pipe):

|Store_SVMTest_aaa=39613349888B;1288490188800;1449551462400;0;1610612736000 vol_m_IS7_sapdata=120789544960B;214748364800;241591910400;0;268435456000 ...

Usage and Display in the Monitoring System

Usually, the web interface shows the SERVICEOUTPUT and provides a link to the LONGSERVICEOUTPUT.

The SERVICEOUTPUT is used for notification via SMS.

Our plugins provide data in these three segments, separated by newlines and a pipe as described in the developer guidelines. All Nagios compatible systems that we know of can process and display this data.

Reducing text outputs – a different subject

These fundamentals won’t help us reduce the amount of data produced by plugins, since we are talking about the presentation layer. However, there are ways for doing just that, as described in Reducing text outputs.