~benji/charms/trusty/nagios/trunk

« back to all changes in this revision

Viewing changes to hooks/common.py

  • Committer: Marco Ceppi
  • Date: 2014-10-14 17:18:28 UTC
  • Revision ID: marco@ceppi.net-20141014171828-8rdqogpvgme8oae0
fix names

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
 
181
181
 
182
182
def update_localhost():
183
 
  """ Update the localhost definition to use the ubuntu icons."""
184
 
  hosts = Model.Host.objects.filter(host_name='localhost',
185
 
                                    object_type='host')
186
 
  for host in hosts:
187
 
     host.icon_image='base/ubuntu.png'
188
 
     host.icon_image_alt='Ubuntu Linux'
189
 
     host.vrml_image='ubuntu.png'
190
 
     host.statusmap_image='base/ubuntu.gd2'
191
 
     host.save()
 
183
    """ Update the localhost definition to use the ubuntu icons."""
 
184
 
 
185
    Model.cfg_file = MAIN_NAGIOS_CFG
 
186
    Model.pynag_directory = os.path.join(MAIN_NAGIOS_DIR, 'conf.d')
 
187
    hosts = Model.Host.objects.filter(host_name='localhost',
 
188
                                      object_type='host')
 
189
    for host in hosts:
 
190
        host.icon_image='base/ubuntu.png'
 
191
        host.icon_image_alt='Ubuntu Linux'
 
192
        host.vrml_image='ubuntu.png'
 
193
        host.statusmap_image='base/ubuntu.gd2'
 
194
        host.save()
192
195
 
193
196
 
194
197
def get_pynag_host(target_id, owner_unit=None, owner_relation=None):