[Xymon] BB Variables to PHP

J.C. Cleaver cleaver at terabithia.org
Wed Oct 7 23:04:26 CEST 2015


On Wed, October 7, 2015 1:01 pm, John Tullis wrote:
> I have created a custom PHP page with simple install instructions for
> servers in our environment. I would like to use the header files but they
> contain Xymon environment variables that can't be accessed outside the
> application. Does anyone have a good way to allow my PHP page access to
> those variables?

John,

Part of the issue is that the various variables there usually change on a
per-page basis. There are few things that you can pick up by wrapping your
php script in xymoncmd with (which will indeed cut down on efficiency,
assuming you're using a shell wrapper), but it sort of depends on what
you're trying to parse out of it.

There's also an option to invert the content generation by running
'xymonpage', which accepts stdin and smashes it into the midst of a
"standard" looking xymon page. You can control which specific type of
header and footer the content gets wrapped in with the --hffile option,
e.g.:

echo '<h2>Hello</h2>' | xymoncmd xymonpage --hffile=info

In your case, perhaps a shell wrapper which executes a php script with
this pipeline might work?

Long term, a more dynamic interface is sorely needed :/ However, a static
template could easily have a javascript or iframe call which statically
includes the current data in the call to whatever web service needs the
data to display something back.


HTH,

-jc




More information about the Xymon mailing list