Configuration Header information displayed before each object definition.

14 views
Skip to first unread message

Ramasamy Jaikumar

unread,
Mar 4, 2015, 4:53:50 AM3/4/15
to pynag-...@googlegroups.com
Hi, 

I created list of service object definition in this way

  for x in [service1, service2, service3, service4]:
   srv = Model.Service()

   srv.set_filename("/home/monitoring/monitor.cfg")

   srv.set_attribute("_service_name", x)

   srv.max_check_attempts = 4

   srv.normal_check_interval = 1

   srv.retry_check_interval = 1

   srv.check_period = "24x7"

   srv.notification_interval = 0

   srv.event_handler_enabled = 1

   srv.save() 

It is creating header lines before each config definition. 

# Configuration file /home/monitoring/monitor.cfg

# Edited by PyNag on Wed Mar  4 09:35:49 2015


define service {

check_period                   24x7                          

notification_interval          0   

         ....

}


# Configuration file /home/monitoring/monitor.cfg

# Edited by PyNag on Wed Mar  4 09:35:49 2015


define service {

 check_period                   24x7                          

 notification_interval          0   

         ....

}



How to avoid the header lines before each object definition and print only on start of the file.

Regards,
Jaikumar

Páll Sigurðsson

unread,
Mar 14, 2015, 12:15:30 PM3/14/15
to pynag-...@googlegroups.com
Hmm we removed that header some time ago. Which version of pynag are you using ? Can you try latest version ?

--
You received this message because you are subscribed to the Google Groups "pynag-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynag-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages