Hello.
I have the following code to check to make sure an url is up. But I need the ?: or alternative code to return a toggle so I can use and loop to send email so problems can be resolved. Here is the code:
#! /usr/sbin/perl -s
# modules needed
use Watchdog::HTTP;
use Mail::Mailer...
This Code posted by Rharsh works pretty good except for one part of it. I'm still trying to get my head wrapped around regex so here is the code and what I would like for it to do:
my $output1 = '268435456 bytes total, 54460416 bytes free';
my $output2 = '13607 in use, 396980 most used'...
Ugh sorry about that. But what I am grabbing is the total amount of memory and the total connections. Here is a sample input that I get and then process from there:
Output2 is 13607 in use, 396980 most used
Output1 is 268435456 bytes total, 54460416 bytes free
I used the following code to...
That helped somewhat. But I'm stil ltrying to figure out a way to trap this junk input before it goes on through the rest of my loops. Here is an input:
Use of uninitialized value in concatenation (.) or string at fw.pl line 93, <STDIN> line 5.
Output2 is
Use of uninitialized value in pattern...
Hello.
I have a script which logs into a PIX to check the number of connections and memory and then strips out what I don't need. But recently I have been having problems with the following error:
Use of uninitialized value in pattern match (m//) at fw.pl line 84, <STDIN> line 5.
Use of...
Hello.
I have a script which gets information from a router in real time. I am wondering if it is possible to format this output in real time. Here is what I am looking for:
Input1 Input2 Input3 Input4
123456 xx.xx 123 Time
What I need is for the format to look nice. Have each...
Okay I made on mistake I'm not very good at regex yet. The second command is in the following format:
123456789 bytes total, 123456789 bytes free
I need to grab the numbers bolded. Sorry about that mistake!
This code below works great.
# If we know it's at the front
if ($output2[0] =~...
Hello.
Sorry if the title doesn't make sense. I have some code that grabs a command from a router and puts it into an @variable. My question is I want to only grab a certain part of the @variable. Here is some of the code:
@output2 = $fw->cmd('show conn count');
print @output2;
Which would...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.