| 1 | #!/usr/bin/perl | ||
| 2 | |||
| 3 | package Ym; | ||
| 4 | |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | use Ym; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | # List of configs that will be generated by Ym. | ||
| 11 | # In ordinary usage there is no need to change it. | ||
| 12 | 1 | our @NAGIOS_CONFIGS = qw/ | |
| 13 | nagios.cfg commands.cfg | ||
| 14 | contact-templates.cfg contactgroups.cfg contacts.cfg | ||
| 15 | host-templates.cfg hostgroups.cfg | ||
| 16 | services.cfg service-templates.cfg | ||
| 17 | timeperiods.cfg | ||
| 18 | service-dependencies.cfg host-dependencies.cfg | ||
| 19 | /; | ||
| 20 | |||
| 21 | # Describes structure where Ym stores parsed configs. | ||
| 22 | # Key - is a main value. If you 'use Ym;' in your programms | ||
| 23 | # you can access Ym config tree using these keys. See ymcmd.pl. | ||
| 24 | # First array element is an object name which is used when | ||
| 25 | # generating object definitions like 'define <object> {' | ||
| 26 | # Second array element tells where to place object definition. | ||
| 27 | # This memo is for information only. | ||
| 28 | # Do not change this data structure uless you have a good reason for that. | ||
| 29 | 1 | our %BRANCHES = ( | |
| 30 | 'commands' => ['command', 'commands.cfg'], | ||
| 31 | 'contact_templates' => ['contact', 'contact-templates.cfg'], | ||
| 32 | 'contactgroups' => ['contactgroup', 'contactgroups.cfg'], | ||
| 33 | 'contacts' => ['contact', 'contacts.cfg'], | ||
| 34 | 'host_templates' => ['host', 'host-templates.cfg'], | ||
| 35 | 'hostgroups' => ['hostgroup', 'hostgroups.cfg'], | ||
| 36 | 'hosts' => ['host', 'services.cfg'], | ||
| 37 | 'service_templates' => ['service', 'service-templates.cfg'], | ||
| 38 | 'timeperiods' => ['timeperiod', 'timeperiods.cfg'], | ||
| 39 | 'service_dependencies' => ['servicedependency', 'service-dependencies.cfg'], | ||
| 40 | 'host_dependencies' => ['hostdependency', 'host-dependencies.cfg'], | ||
| 41 | 'services' => ['service',], | ||
| 42 | ); | ||
| 43 | |||
| 44 | |||