Xymon Mailing List Archive search

XML Parsing

list Jason Chambers
Wed, 2 Dec 2009 10:20:06 -0500
Message-Id: <user-eccb2f4c052b@xymon.invalid>

I want to parse the Ironport xml status file and make it useful... kinda looks like this:

<status build="phoebe 6.5.3-007" hostname="mail.somemailserver.com" timestamp="20091202095834">
  <birth_time timestamp="20091010092305 (53d 1h 35m 29s)"/>
  <last_counter_reset timestamp="20080408102414"/>
  <system status="online" />
  <oldest_message secs="191115" mid="2033351" />
  <features>
    <feature name="IronPort Anti-Spam" time_remaining="75474158" />
    <feature name="Sophos" time_remaining="75430958" />
    <feature name="McAfee" time_remaining="-50177672" />
  </features>
  <counters>
    <counter name="inj_msgs"
        reset="1672658"
        uptime="135602"
        lifetime="1672668" />
    <counter name="inj_recips"
        reset="1879254"
        uptime="147263"
        lifetime="1879264" />
    <counter name="gen_bounce_recips"
        reset="52001"
        uptime="3664"
        lifetime="52006" />
    <counter name="rejected_recips"
        reset="391394"
        uptime="16835"
        lifetime="391394" />
    <counter name="dropped_msgs"
        reset="476453"
        uptime="16952"
        lifetime="476453" />
    <counter name="soft_bounced_evts"
        reset="42976"
        uptime="7217"
        lifetime="42976" />
    <counter name="completed_recips"

Etc...

Jason Chambers
IT Help Desk Associate

GEOSOFT INC.
freedom to explore
T +X XXX.XXX.XXXX #344
F +X XXX.XXX.XXXX

Visit our user-be8ce7065ec5@xymon.invalid

From: Jerald Sheets [mailto:user-96a6f34c5806@xymon.invalid]
Sent: December-02-09 10:08 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] XML Parsing

For what purposes and in what way?

Are you wanting to use it as a config element?  Are you wanting to search through it for a pattern match?

With the open-ended scripting you can do in Hobbit, the *what* you are asking is a non-issue.  The *how* based on the *why* is the important part.


---
Jerald M. Sheets jr.

On Wed, Dec 2, 2009 at 9:41 AM, Jason Chambers <user-3fa671c0a30d@xymon.invalid<mailto:user-3fa671c0a30d@xymon.invalid>> wrote:
Does anyone know how I can go about parsing data out of an XML txt file and then including it into hobbit? That would be extremely cool if there is an easy way to do that.

Jason Chambers
IT Help Desk Associate

GEOSOFT INC.
freedom to explore
T +X XXX.XXX.XXXX #344
F +X XXX.XXX.XXXX

Visit our user-be8ce7065ec5@xymon.invalid<http://www.geosoft.com>;