Difference between revisions of "Nagios"
Jump to navigation
Jump to search
m (Another draft) |
m (→Useful Paths etc: Tidy up) |
||
Line 30: | Line 30: | ||
== Create SNMP Checks == | |||
Everything here creates various checks for my '''QNAP NAS''', which I've used as an example. | Everything here creates various checks for my '''QNAP NAS''', which I've used as an example. | ||
=== Define OID's to Poll === | |||
Before you start you need to know what SNMP OID's you want to poll, and what they're values should be. For common devices and metrics you can often get by with a Google search or two, but it doesn't take much for you to need to get a bit more involved. | Before you start you need to know what SNMP OID's you want to poll, and what they're values should be. For common devices and metrics you can often get by with a Google search or two, but it doesn't take much for you to need to get a bit more involved. | ||
Line 114: | Line 56: | ||
=== Create Commands === | |||
Each type of check needs a command defined for it, which where the SNMP OID that will be checked is defined. Commands are are not specific to a particular host, so could be run against any system for which the check would be valid. There is some flexibility in that if you've certain checks that will be similar (eg checks for status of disk 1, disk 2 etc) then you can add arguments to the checks that can be defined later on. | Each type of check needs a command defined for it, which where the SNMP OID that will be checked is defined. Commands are are not specific to a particular host, so could be run against any system for which the check would be valid. There is some flexibility in that if you've certain checks that will be similar (eg checks for status of disk 1, disk 2 etc) then you can add arguments to the checks that can be defined later on. | ||
Line 164: | Line 106: | ||
== Create Services == | |||
Services are used to define a generic check command within the bounds of a specific service. So for example, you could define two separate disk space checks, using the same command definition, but with different alerting thresholds depending on your requirements. | Services are used to define a generic check command within the bounds of a specific service. So for example, you could define two separate disk space checks, using the same command definition, but with different alerting thresholds depending on your requirements. | ||
Services need to be defined with... | Services need to be defined with... | ||
* <code> hostgroup_name </code> - The hostgroup defines which servers will have the service checks applied to it. For a host to be checked for the service it needs to be a member of the hostgroup, see [[#Create Hostgroup]] for further info. | * <code> hostgroup_name </code> - The hostgroup defines which servers will have the service checks applied to it. For a host to be checked for the service it needs to be a member of the hostgroup, see [[#Create Hostgroup|Create Hostgroup]] for further info. | ||
* <code> service_description </code> - A name for the service check, this is what is displayed in the Service field on the Nagios display | * <code> service_description </code> - A name for the service check, this is what is displayed in the Service field on the Nagios display | ||
* <code> check_command </code> - The command (and its parameters, if any) to perform the check. | * <code> check_command </code> - The command (and its parameters, if any) to perform the check. | ||
Line 212: | Line 154: | ||
== Create Hostgroup == | |||
The hostgroup definition allows you to group one or more hosts together, in order to have service checks run against them. So in the above I created services that would apply to hosts in the <code>qnap-nas</code> hostgroup. I can then add my NAS server to this hostgroup in order for it to be monitored (hostgroup definitions are normally found in <code>/etc/nagios3/conf.d/hostgroups_nagios2.cfg</code> | The hostgroup definition allows you to group one or more hosts together, in order to have service checks run against them. So in the above I created services that would apply to hosts in the <code>qnap-nas</code> hostgroup. I can then add my NAS server to this hostgroup in order for it to be monitored (hostgroup definitions are normally found in <code>/etc/nagios3/conf.d/hostgroups_nagios2.cfg</code> | ||