lconf ldif helper for default-templates.cfg

To be used with Lconf config, as it relates to the use of /usr/local/LConf/etc/default-templates.cfg.

ldapadd -h localhost -x -D "cn=Manager,dc=icinga,dc=cfg" -f ~/default_structure.ldif -w ldap_PASSWORD

The contents of default_structure.ldif should be as follows… watch out for pasting into a console window

version: 1

#
# LDAPv3
# base <ou=LConf,dc=icinga,dc=cfg> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# default_conf, IcingaConfig, LConf, icinga.cfg
dn: ou=default_conf,ou=IcingaConfig,ou=LConf,dc=icinga,dc=cfg
ou: default_conf
objectClass: lconfStructuralObject

# 24x7, default_conf, IcingaConfig, LConf, icinga.cfg
dn: cn=24x7,ou=default_conf,ou=IcingaConfig,ou=LConf,dc=icinga,dc=cfg
lconfAlias: 24x7
cn: 24x7
objectClass: lconfTimeperiod
lconfTimeperiodValue:: c3VuZGF5IDAwOjAwLTI0OjAwIA==
lconfTimeperiodValue:: c2F0dXJkYXkgMDA6MDAtMjQ6MDAg
lconfTimeperiodValue:: ZnJpZGF5IDAwOjAwLTI0OjAwIA==
lconfTimeperiodValue:: dGh1cnNkYXkgMDA6MDAtMjQ6MDAg
lconfTimeperiodValue:: d2VkbmVzZGF5IDAwOjAwLTI0OjAwIA==
lconfTimeperiodValue:: dHVlc2RheSAwMDowMC0yNDowMCA=
lconfTimeperiodValue: monday 00:00-24:00

# notify-host-by-email, default_conf, IcingaConfig, LConf, icinga.cfg
dn: cn=notify-host-by-email,ou=default_conf,ou=IcingaConfig,ou=LConf,dc=icinga,dc=cfg
lconfCommandline: /usr/bin/printf "%b" "***** icinga Notification *****\n\nType:$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nDate/Time: $DATE$" | @MAILER@ -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
cn: notify-host-by-email
objectClass: lconfCommand

# notify-service-by-email, default_conf, IcingaConfig, LConf, icinga.cfg
dn: cn=notify-service-by-email,ou=default_conf,ou=IcingaConfig,ou=LConf,dc=icinga,dc=cfg
lconfCommandline: /usr/bin/printf "%b" "***** icinga Notification *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIA S$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATE$ Additi onal Info : $SERVICEOUTPUT$" | @MAILER@ -s "** $NOTIFICATIONTYPE$ alert - $HO STALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
cn: notify-service-by-email
objectClass: lconfCommand

# root, default_conf, IcingaConfig, LConf, icinga.cfg
dn: cn=root,ou=default_conf,ou=IcingaConfig,ou=LConf,dc=icinga,dc=cfg
lconfAlias: root
cn: root
objectClass: lconfContact
lconfEmail: root

# admins, default_conf, IcingaConfig, LConf, icinga.cfg
dn: cn=admins,ou=default_conf,ou=IcingaConfig,ou=LConf,dc=icinga,dc=cfg
lconfAlias: admins
cn: admins
objectClass: lconfContactgroup
lconfMembers: root

# check-host-alive, default_conf, IcingaConfig, LConf, icinga.cfg
dn: cn=check-host-alive,ou=default_conf,ou=IcingaConfig,ou=LConf,dc=icinga,dc= cfg
lconfCommandline: $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
cn: check-host-alive
objectClass: lconfCommand
Advertisements
  1. Pedro B.
    March 4, 2013 at 9:33 am

    First of all, congratulations on the excellent posts about icinga. Thanks to you i was able to understand and create an awesome monitoring system in our company.
    Meanwhile in the default_structure.ldif, where you have the lconfCommandline for check-host-alive the critical value should have no spaces between “5000.0,” and “100%”. At least in our server the command return an error on the critical value.

    • March 4, 2013 at 9:36 am

      I’m very happy to help! This was my main purpose. I really like icinga-web with ingraph, and lconf is a change for many people, but if you suffer through a migration from just flat nagios files (or another configuration file generator), I believe you will be better off in the end.

      Thanks for pointing out the error! It has been fixed!

      Feel free to post back with any more comments.

      Thanks,

      Matt

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: