Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Greetings Monks,

I've got a problem at work that's I've been avoiding since not a 100% perl problem but after reading Empowered by Perl I was rejuvenated and I feel empowered enough to tackle it again!

We've got several pieces of equipment that we need to monitor the health of. Now, in the past this has just been done by calling the 'fix-it' guy as soon as it breaks. I did a little snooping and found a option to print a pretty detailed report containing a bunch of values that we might be interested in monitoring. It's even in a nice form that would be cake to parse with perl. I contacted the software company to see if they had an API that I could directly query to get that information out or a command line switch to generate that report to STDOUT, only to be disappointed. I get the feeling that when they were developing the software, they didn't foresee any single company owning as many of these as we do so I can't say that I blame them.

Ideally, I'd like to set up a 'cron' job (of course these all run on Windows so I'm not sure that's trivial) to generate that report in plain text and save it somewhere on the network, then I can get another perl script to parse them and add them to a sqlite database.

So I seek your wisdom regarding the following problems:

  • How could I set up a perl program (or another program) to act as a printer so I can get the output in plain text? (Essentially a 'print to file' workaround since there's no other output for that report besides printing it.)
  • How can I run that command (which, as far as I know, needs to be selected from the GUI's menu) in this program at scheduled intervals?

Thanks in advance for your insights, any thoughts on another approach would be greatly appreciated!


In reply to Collecting data from a program that doesn't make it easy by c4onastick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-23 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found