process-monitoring

advertisement
Monitoring items can be attached to either templates or hosts. The "hosts" scenario is easier and
illustrated here. Adding an item to templates is very similar.
Begin by clicking Configuration->Hosts, selecting the desired Hostgroup from the drop-down box, and
finally selecting the "Items" link for the individual host:
On the following screen, click "Create Item." The item fields are defined as:
Host: which single host holds this particular item; for multiple hosts, use templates instead.
Description: the item's name. This should be short and descriptive.
Type: where the item data comes from (typically the Zabbix agent.)
Key: the specific item we're interested (populated by above "Type" field.)
Type of information: each key (above) requires a specific type (see the manual.)
Data type: how Zabbix will interpret this data--almost always "Decimal."
Units: a data unit suffix, such as % or Bytes.
Custom multiplier: data conversion (e.g., ".001" converts KBytes to MBytes.)
Update interval: number of seconds between checks ("60" is the minimum allowed.)
Flexible intervals: a delay (in seconds) during the specified time period.
Keep history: number of days fine-grained data is stored (use one day max.)
Keep trends: number of days coarse-grained (hourly) data is stored (use 365 or less.)
Status: determines if the item data is actively being collected.
Store value: allows item to store deltas (changes in value) if desired.
Show value: advanced configuration--do not use.
Applications: allows grouping items into one applications for display/graphing purposes.
Group: allow an item to be applied to an entire hostgroups--always use templates instead.
We want to create an item that monitors our Nagios process on fillet01.oit.umn.edu. We first examine
the process list:
(On a Windows host, we would use Task Manager or the "tasklist" command instead.)
From the Zabbix manual, the simplest way to watch a process is the "proc.num"(number of running
processes) key. The syntax is:
proc.num[<name>,<user>,<state>,<cmdline>]
name: /opt/nagios/bin/nagios
user: nagios
state: run
cmdline: /opt/nagios/etc/nagios.cfg
However, all of the arguments are optional. So we prune our key down to
proc.num[nagios,,,"-d /opt/nagios/etc/nagios.cfg"]
where commas are used to indicate empty arguments.
Once finished, this item will collect the number of nagios processes running and store them in Zabbix's
database. We can use the "latest data" functionality to view these values. More importantly, we can
create triggers and actions based on these values and send alerts if the process dies.
Download