What IP range based tagger is done for
You can define a tagger that will use IP ranges to automatically add host templates to detected objects. The common tagger named ip-tags can load new ip range rules with modules.
How to define a new IP Range rule
For each IP range rule, you will need to define a new module and add it in the ip-tags configuration.
You can copy the sample module /etc/shinken/modules/ip-tag-dmz.cfg into a new file name and edit it:
| Code Block |
|---|
define module{
module_name ip-tag-dc1
module_type sync_ip_tag
ip_range 192.168.0.0/24
method append ; replace or append
property use
value dc1
} |
The properties are:
- module_name: must be unique in the modules
- module_type: must be equal to sync_ip_tag
- ip_range: the ip range you want to match
- method: how you want to modify your detected object:
- replace: put the value if not another one is in place
- append: add the value at the END of the host templates
- prepend: add the value at on the BEGINING of the host templates
- set: just the value, erase what was before.
- replace: put the value if not another one is in place
- property: which host property to change. By default the property is "use" (host templates)
- value: which value to set/append/prepend/replace
Then you must edit the ip-tags tagger definition to link your new module in the file /etc/shinken/taggers/ip-tags.cfg:
| Code Block |
|---|
define tagger {
tagger_name ip-tags
order 1
modules ip-tag-dmz,ip-tag-dc1
description This tagger will tag hosts based on their ip range
}
|
Then you must restart your shinken-synchronizer daemon.