The highlighting in the UI was one of the main reasons I asked -- I
wasn't sure if you were tracking changes and making incremental updates
to the nagios configuration or if it was simply a UI feature.

By 'provided perl libraries', do you mean that Opsview has perl modules
and a perl API I can hook into to handle this stuff? POD in the modules?
I've done a quick scan of the @INC dirs on the 3.7.0 virtual appliance
and /usr/local/nagios/perl/lib and I'm not seeing anything jumping out
at me; i.e. nothing in an Opsera:: or Opsview:: namespace. Everything
looks like its from CPAN. Or are you just referring to using DBI?

Believe me, if there was a way to do this without hooking into the
database backend I'd do that instead.

-Matt

-----Original Message-----
From: opsview-users-boun...@lists.opsview.org
[mailto:opsview-users-boun...@lists.opsview.org] On Behalf Of Duncan
Ferguson
Sent: Thursday, June 03, 2010 10:54 AM
To: Opsview Users
Subject: Re: [opsview-users] Programmatically inserting hosts with
eventhandlers


On 1 Jun 2010, at 16:02, Matt Rose wrote:

> As far as I can tell, the API XML .rng doesn't have event handler
> configuration defined for the create action. Granted, this check was
> done by simply doing a search for 'event' and coming up with nothing,
> then scanning over it to see if it was named something else.
> 
> Did I miss it? If so, what's the XML schema for defining it at host
> creation?

I believe we may have some work coming up soon to improve the API - at
the moment there are several pieces of functionality missing such as
this one.

> If I didn't miss it, do I have any option but to find a service check
ID
> and host ID and insert an appropriate mapping into
> opsview.hostserviceeventhandlers, checking opsview.hostservicechecks
to
> make sure the service check I'm handling wasn't inherited from a
> template, and inserting a service check mapping into
> opsview.hostservicecheck if needed?

Yes, it is possible to do it that way, but please make sure you back up
your opsview database before making any changes.  You are best using a
perl script and the provided perl libraries to perform such as task as
there are various helper functions for resolving templates and so on.
There may be something useful in the utils directory you can use as a
base.
> 
> Finally, if that's my only option, do I need to do anything else to
let
> Opsview know the configuration for the host has been changed behind
its
> back so that the host's configuration gets properly created when the
> configs are reloaded?

At reload time all the config is pulled from the database so as long as
the database changes are sane then you should be ok.  In reference to
the UI seeing the changes you should set 'uncommitted' on relevant
objects in the DB so they get highlighted in the UI.

We generally don't recommend manipulating the database like this, but it
is probably your only option at this time. 

  Duncs

-- 
Duncan Ferguson
Senior Developer/Support Engineer


_______________________________________________
Opsview-users mailing list
Opsview-users@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-users

Reply via email to