Hi,

I have a small problem, I'm trying to do the following.

I'm using WOTS to scan logfiles, and when it gets an error from our name server, it 
has to cut the error message in pieces separated by a space.
And has to compare it to the if statements. After that it has to copy a few pieces to 
make an email to warn our customers.
This is an example of an error message: 

Mar 16 12:12:04 ns4 named-xfer[16809]: [212.104.202.50] not authoritative for 
ero-art.com, SOA query got rcode 0, aa 0,
ancount 0, aucount 12

My problem is, when the script detects a ' [, ],(,)' It says  "no match" and it just 
stops.

My problem is the beginning of my script. I tried several ways to solve this, but to 
no avail.
The script is run in the following manner

namescript Mar 16 12:12:04 ns4 named-xfer[16809]: [212.104.202.50] not authoritative 
for ero-art.com, SOA query got rcode 0, aa 0,
ancount 0, aucount 12

the error is appended to my script, I can also do 

namescript "Mar 16 12:12:04 ns4 named-xfer[16809]: [212.104.202.50] not authoritative 
for ero-art.com, SOA query got rcode 0, aa 0,
ancount 0, aucount 12"

I hope you can help me with this, I've run out of options here. I'm used to C and not 
perl

Thanks in advance

Jose Vazquez
[EMAIL PROTECTED]

##################################################################
#!/usr/bin/perl

for ($i=0;$i<20;$i++) {
       @zin[$i] = $ARGV[$i];
       print "@zin[$i] \n\r";
}

#print "@zin";
#$_ = $zin;
# $zin = $ARGV;

print "$zin";

$ta = @zin[6];
$tb = @zin[7];
$tc = @zin[8];
$td = @zin[9];

for ($t=0;$t<20;$t++) {

if (@zin[$t] = /212.104.202.50/g) {
        $name = "NS1.NETCASE.NL";
        $email = '[EMAIL PROTECTED]';
        $bericht ="Hoi wij krijgen de melding $ta $tb $tc $td van $name, kunnen jullie 
hier iets aan doen?";
}

elsif (@zin[$t] = /16809/g) {
        $name = "NS1.test.NL";
        $email = '[EMAIL PROTECTED]';
        $bericht ="Hoi wij krijgen de melding $ta $tb $tc $td van $name, kunnen jullie 
hier iets aan doen?";
}

elsif (@zin[$t] = /212.104.194.5/g) {
        $name = "NS.VSM-HOSTING.NL";
        $email = '[EMAIL PROTECTED]';
        $bericht ="Hoi wij krijgen de melding $ta $tb $tc $td van $name, kunnen jullie 
hier iets aan doen?";
}

elsif (@zin[$t] = /195.114.231.200/g) {
        $name = "NS2.SUPPORT.NL";
        $email = '[EMAIL PROTECTED]';
        $bericht ="Hoi wij krijgen de melding $ta $tb $tc $td van $name, kunnen jullie 
hier iets aan doen?";
}

elsif (@zin[$t] = /212.104.201.196/g) {
        $name = "NS1.SCHROER.NL";
        $email = '[EMAIL PROTECTED]';
        $bericht ="Hoi wij krijgen de melding $ta $tb $tc $td van $name, kunnen jullie 
hier iets aan doen?";
}

elsif (@zin[$t] = /212.104.197.10/g) {
        $name = "NS1.PROMISUM.NL";
        $email = '[EMAIL PROTECTED]';
        $bericht ="Hoi wij krijgen de melding $ta $tb $tc $td van $name, kunnen jullie 
hier iets aan doen?";
}

else {
        $email = '[EMAIL PROTECTED]';
        open(M,"|/usr/sbin/sendmail $email") || die $!;
        print M "Subject: Fout op nameserver!\n";
        print M "\n"; # header en body scheiden dmv een lege regel
        print M "@zin, $1, $&";
        close M;
        exit;
}

}
open(M,"|/usr/sbin/sendmail $email") || die $!;
print M "Subject: Er is een fout opgetreden bij ophalen domein van uw nameserver!\n";
print M "\n"; # header en body scheiden dmv een lege regel
print M "$bericht";
close M;
###################################################################################


Reply via email to