Nagios

Using The Nagiostats Utility


Up ToUp To: Contents
See Also See Also: Graphing Performance Info, Performance Tuning

Introduction

A utility called nagiostats is included in the Nagios distribution. It is compiled and installed along with the main Nagios daemon. The nagiostats utility allows you to obtain various information about a running Nagios process that can be very helpful in tuning performance. You can obtain information either in human-readable or MRTG-compatible format.

Usage Information

You can run the nagiostats utility with the --help option to get usage information.

Human-Readable Output

To obtain human-readable information on the performance of a running Nagios process, run the nagiostats utility with the -c command line argument to specify your main configuration file location like such:


[nagios@lanman ~]# /usr/local/nagios/bin/nagiostats -c /usr/local/nagios/etc/nagios.cfg





Nagios Stats 3.0prealpha-05202006

Copyright (c) 2003-2007 Ethan Galstad (www.nagios.org)

Last Modified: 05-20-2006

License: GPL



CURRENT STATUS DATA

------------------------------------------------------

Status File:                            /usr/local/nagios/var/status.dat

Status File Age:                        0d 0h 0m 9s

Status File Version:                    3.0prealpha-05202006



Program Running Time:                   0d 5h 20m 39s

Nagios PID:                             10119

Used/High/Total Command Buffers:        0 / 0 / 64

Used/High/Total Check Result Buffers:   0 / 7 / 512



Total Services:                         95

Services Checked:                       94

Services Scheduled:                     91

Services Actively Checked:              94

Services Passively Checked:             1

Total Service State Change:             0.000 / 78.950 / 1.026 %

Active Service Latency:                 0.000 / 4.272 / 0.561 sec

Active Service Execution Time:          0.000 / 60.007 / 2.066 sec

Active Service State Change:            0.000 / 78.950 / 1.037 %

Active Services Last 1/5/15/60 min:     4 / 68 / 91 / 91

Passive Service State Change:           0.000 / 0.000 / 0.000 %

Passive Services Last 1/5/15/60 min:    0 / 0 / 0 / 0

Services Ok/Warn/Unk/Crit:              58 / 16 / 0 / 21

Services Flapping:                      1

Services In Downtime:                   0



Total Hosts:                            24

Hosts Checked:                          24

Hosts Scheduled:                        24

Hosts Actively Checked:                 24

Host Passively Checked:                 0

Total Host State Change:                0.000 / 9.210 / 0.384 %

Active Host Latency:                    0.000 / 0.446 / 0.219 sec

Active Host Execution Time:             1.019 / 10.034 / 2.764 sec

Active Host State Change:               0.000 / 9.210 / 0.384 %

Active Hosts Last 1/5/15/60 min:        5 / 22 / 24 / 24

Passive Host State Change:              0.000 / 0.000 / 0.000 %

Passive Hosts Last 1/5/15/60 min:       0 / 0 / 0 / 0

Hosts Up/Down/Unreach:                  18 / 4 / 2

Hosts Flapping:                         0

Hosts In Downtime:                      0



Active Host Checks Last 1/5/15 min:     9 / 52 / 164

   Scheduled:                           4 / 23 / 75

   On-demand:                           3 / 23 / 69

   Cached:                              2 / 6 / 20

Passive Host Checks Last 1/5/15 min:    0 / 0 / 0

Active Service Checks Last 1/5/15 min:  9 / 80 / 244

   Scheduled:                           9 / 80 / 244

   On-demand:                           0 / 0 / 0

   Cached:                              0 / 0 / 0

Passive Service Checks Last 1/5/15 min: 0 / 0 / 0



External Commands Last 1/5/15 min:      0 / 0 / 0



[nagios@lanman ~]# 

As you can see, the utility displays a number of different metrics pertaining to the Nagios process. Metrics which have multiple values are (unless otherwise specified) min, max and average values for that particular metric.

MRTG Integration

You can use the nagiostats utility to display various Nagios metrics using MRTG (or other compatible program). To do so, run the nagiostats utility using the --mrtg and --data arguments. The --data argument is used to specify what statistics should be graphed. Possible values for the --data argument can be found by running the nagiostats utility with the --help option.

Note Note: Information on using the nagiostats utility to generate MRTG graphs for Nagios performance statistics can be found here.