External commands enable you to add your own configuration data that is not related to Nagios but can be useful when integrating other tools. When externals are enabled, this data can be added to host and service profiles, which can then be applied to instantiated host and service definitions.
Executing the Build Externals command will call a user written program in
MonarchExternals.pm. The user program can process the externals data associated with the host and service definitions in Monarch. For example, the externals data can be used to generate a configuration update for another monitoring tool based on Monarch changes. This is an advanced feature that requires some knowledge of Perl to modify
Enabling and searching externals
Externals are enabled by default. To verify, go to Configuration > Nagios Monitoring > Control, and check to see if the Enable Externals box is checked (enabled).
If enabled, you can then define, add, and execute externals.
Additionally, you have the ability to search for service and host externals. When externals are enabled the Search Service Externals and the Search Host Externals options will be available under Services and Hosts.
For example, go to Configuration > Nagios Monitoring > Services > Search service externals.
Enter any part of an external name to search. You can then select an existing external to delete, rename, or copy.
Creating, adding, and building externals
To create a host or service external, select Configuration > Nagios Monitoring > Hosts (or Services).
Select Host Externals (or Service Externals) and select New, (or Copy).
Enter a Name, and Detail for the external and Add and Continue, you will then see the new external listed under Modify.
You can then add host externals by selecting Host > Detail > Host Externals, and service externals by selecting Service > Service Externals.
When externals files are built, they have to be placed somewhere in the filesystem. That location is specified in a top-level Monarch Group used for that purpose. Each of the hosts which you wish to create externals for must be belong to such a Monarch Group. The Build folder for the Monarch Group specifies where the created externals files are to be placed. The Nagios etc folder field for the Monarch Group must be left blank.
Another function of the Monarch Group in this regard is that it manages the definitions of macro substitutions that may be made into externals definitions when the externals files are built. Complex setups can be defined by further refinement using Monarch Group sub-groups; when a host belongs to both a group and one of its sub-groups, the macro definitions in sub-groups take precedence over similar definitions in their parent groups.
For a full description of macro expansion in externals, see Process for Macro Substitutions in the GDMA documentation.
In the current standard version of the
MonarchExternals.pm scripting, externals will not be generated for a given host if the host has only host-service externals attached, and no host externals. This may change in a future release.
To build the full set of external files associated with hosts in configuration groups, first select Configuration > Nagios Monitoring > Control.
Then select Build Externals, which will execute the code in
- The standard version of this module will analyze the hosts in each group and subgroup, analyze the group/subgroup hierarchies, collect together the host and service externals for each host, and perform macro substitution on those externals.
- For each such host, if the result is different from the prior content of the externals file (if any), a new copy of the externals file will be written out.
- Finally, old externals files which were previously in the filesystem but are no longer specified by the current configuration will be removed. Statistics on the analysis and actions will be printed on-screen so you have some idea of what transpired.