homedjagios for all

Utils

Exporter

class djagios.common.utils.Exporter

Exporter provides the functionality to export the different objects to the correct format used by Nagios. This tool will have to be adapted each time the configuration format of Nagios changes.

export(path)

export will run over all objects and export them one by one to the specified path. Here they will be ordered per objecttype. The export is not recursive.

Parameter:path (str) – containing the location where to put the cfg files, must be a directory
export_object(nagios_obj, path)

export_object() will open a file (with the name of the object type) and write the content of the object to it.

To do that It depends on the export function defined in the model class.

Parameters:
  • nagios_obj (djagios.core.models.NagiosObject) – object that should be written as a nagios config object
  • path (str) – containing the location of the configfiles.

Table Of Contents

Previous topic

Exceptions

Next topic

Templates

This Page