Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20019

Re: Re: How can I avoid "Can't identify dynamic column definitions from script output." message when I run a perl script?

$
0
0

I took a few minutes (yay for TechEd 2014 downtime), and took a look at it.  Fortunately the URL you posted is publicly available, so I could test the output... This seems to generate the correct output. I don't have my test environment in front of me, so I cannot validate completely:

 

#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
$|=1;
getstore('http://kannel1.us.spireon.com:13000/status', 'url.html') or die 'Unable to get page';
sub main {    my $file = 'url.html';    open(INPUT,$file) or die("input file $file not found.\n");    while (my $line = <INPUT>) {         # Uptime stats           if ($line =~ / uptime([^\n]*) /){           print "Statistic.uptime: $1\n";           print "Message.uptime: SMS Uptime is $1\n";       }       # received Stats       if ($line =~ /SMS: received \b([\d]+)[\S ]*sent \b([\d]+) /){            print "Statistic.smsreceived: $1\n";            print "Message.smsreceived: SMS Received $1\n";            print "Statistic.smssent: $2\n";            print "Message.smssent: SMS Sent $2\n";           }             }   close(INPUT);
}
main();

 

This executed outputs the following (at time of execution):

 

Statistic.uptime:  11d 22h 23m
Message.uptime: SMS Uptime is  11d 22h 23m
Statistic.smsreceived: 3511
Message.smsreceived: SMS Received 3511
Statistic.smssent: 12165
Message.smssent: SMS Sent 12165

 

SolarWinds should be mostly happy with that output.  The one that might give it a hard time is the "uptime" value. It's not an integer of any type, so it might have a hard time with the output. You may need to do magic to that.


Viewing all articles
Browse latest Browse all 20019

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>