RE: [Nagios-devel] nagios php interface version 0.01

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

RE: [Nagios-devel] nagios php interface version 0.01

Post by Guest »

You'll have to grab the code from CVS. Its not documented anywhere,
but the format is fairly straightforward and its working.

Once Nagios is running, take a look at the status file, along with
the comment and downtime files. The status file I/O routines can be
found in xdata/xsddefault.c and should be fairly clear. The comment
and downtime routines are found in xdata/xcddefault.c and
xdata/xdddefault.c, respectively. The status/comment/downtime data
is now stored in a stanzad format, similar to object definitions.

The cached object file contains standard object definitions in
stanzad format. The only difference from the "raw" object config
files is that they've already been resolved. Also, each possible
directive/value for each definition type is included in the cached
definitions.

Note: You'll have to move contact_group directives from your
hostgroup definition to host definitions before you can start Nagios -
this was the only real change to the format of object definitions in
2.0.


On 14 Apr 2003 at 22:12, Mark Musone wrote:

> So basically all of the "flattening" I did in php is not needed :^P :^)
>
> Where can I get the details about the formats for 2.0 ???
> Or is it non-existant currently? Should I just look at the CVS
> Code to determine the formats?
>
>
> -Mark
>
>
> -----Original Message-----
> From: nagios-devel-admin@lists.sourceforge.net
> [mailto:nagios-devel-admin@lists.sourceforge.net] On Behalf Of Ethan
> Galstad
> Sent: Monday, April 14, 2003 9:22 PM
> To: nagios-devel@lists.sourceforge.net
> Subject: Re: [Nagios-devel] nagios php interface version 0.01
>
> Since you've taken the leap on a big project, I'll throw in a few
> comments. :-)
>
> I would plan on developing this to work with 2.0, rather than 1.0.
> The format of the status, comment, and downtime files have changed in
> 2.0.
>
> Also, 2.0 has a cached object file (var/objects.cache by default)
> that is created after Nagios starts. It contains a "flattened" view
> of all object definitions that were present when Nagios started. All
> definitions have already been resolved, replicated, and all the fancy
> tricks are applied before this file gets created. This makes it very
> easy for external apps (like the PHP interface) to parse the config
> without having to worry about changes in how Nagios parses the raw
> object definition files.
>
> Lastly, I personally believe that many of the current CGIs are
> horrendous, so I wouldn't be too worried about replicating their look
> and feel exactly. I think moving to a PHP interface would be a good
> time to evaluate some different interface designs before anything is
> nailed in stone. This might include things like a tabbed interface,
> hiding links that are not used very often, using drop-down menus for
> command lists (as in the host/service detail view of extinfo.cgi),
> etc. Food for thought anyway.
>
> I will likely be able to give you a hand with much of the conversion,
> but not until 2.0 goes beta. I need to finish up the major coding
> and start writing documentation before I can move on to something
> new.
>
>
> On 13 Apr 2003 at 13:37, Mark Musone wrote:
>
> > Ok,
> >
> > This is not by any means done. In fact I'm only releasing it so that
> > Others can help. It is purely a developmental version right now!!
> >
> > This _should_ be a drop-in replacement for the cgi's. Just drop this
> in
> > a htdocs directory (Not cgi-bin) that has nagios and php. It _should_
> > read
> > The default nagios.cfg file in /usr/local/nagios/etc/nagios.cfg.
> >
> > If your nagios.cfg file is somewhere else, then change the value in
> the
> > file readconfig.php:
> >
> > $config_file = '/usr/local/nagios/etc/nagios.cfg';
> >
> > >From there, it _should_ bootstrap itself and load all the other
> > configs...
> >
> > Note, it does NOT currently do ALL the parsing and object types,
> > especially the "timesaving" tricks. It should do all the basic parsing
> > of all the types. It also handles object templates (i.e. objects with
> a
> > "use" directive) and it handles wildcard services (ones with

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: nagios@nagios.org
Locked