Nacoma Hooks

[TOC]

Introduction

Nacoma can run hooks at certain actions. Currently, only 'save' hooks are implemented, although others may come along later if needed.

Save hook

The hooks in the save hook directory are executed after the configuration files are flushed from database and Nagios has verified them.

Note:
The save hook(s) will be run by the webserver when a save command is issued from the user interface, and as the console user when a save command is issued by the cli tools.

The first argument to the hook is the username of the person pressing the 'save' button.

The second argument is the full name of the person, taken from the contact with the contact_name of the user performing the action. If no contact can be found, the second argument will be a nul string.

The hooks get fed the changelog entries, accumulated since the user last imported the configuration files (undo) or flushed them from database to files (save).

The format of the strings it gets fed is as follows (lines are broken here for readability):

object_id='<int>'\tuser='<string>'\tpre_name='<string>'\tpost_name='<string>'\
        \tpre='k1=v1;k2=v2;kn=vn'\tpost='k1=v1;k2=v2;kn=vn'

Legend:

There is no need to use this hook capability to save the changelog, as that's taken care of by Nacoma anyway.

 All Data Structures Functions Variables

Generated on 27 May 2019 for nacoma by  doxygen 1.6.1