47 |
} |
} |
48 |
close(O); |
close(O); |
49 |
} |
} |
50 |
|
|
51 |
$dbh->do ("insert into gantt (sessionid,type,status, |
$sql = "insert into gantt (sessionid,type,status, |
52 |
user_group_host,specification,device,host) values |
user_group_host,specification,device,host) values |
53 |
('$omni{SessionID}','$omni{Session_type}', |
('$omni{SessionID}','$omni{Session_type}', |
54 |
'$omni{Session_status}', |
'$omni{Session_status}', |
55 |
'".$omni{'User.Group@Host'}."', |
'".$omni{'User.Group@Host'}."', |
56 |
'$omni{Backup_Specification}', |
'$omni{Backup_Specification}', |
57 |
'$device','$host')") |
'$device','$host')"; |
58 |
|
|
59 |
|
$dbh->do($sql) || warn "$sql : ".$dbh->errstr(); |
60 |
|
|
61 |
} |
} |
62 |
} |
} |
63 |
|
|
64 |
open(O, "/usr/omni/bin/omnistat -detail |") || die "omnistat: $!"; |
open(O, "/usr/omni/bin/omnistat -detail |") || die "omnistat: $!"; |
65 |
while(<O>) { |
if (!eof(O)) { |
66 |
chomp; |
# somehow, from time to time omnistats dies before we get here |
67 |
if (/^$/) { |
# this is a workaround to keep cron e-mails from reporting it. |
68 |
db(); |
while(<O>) { |
69 |
%omni = (); |
chomp; |
70 |
print "------------\n" if ($debug); |
if (/^$/) { |
71 |
next; |
db(); |
72 |
} |
%omni = (); |
73 |
s/^[\t\s]+//; |
print "------------\n" if ($debug); |
74 |
my ($l,$r) = split (/\s*:\s*/,$_,2); |
next; |
75 |
if ($r) { |
} |
76 |
$l =~ s/\s+/_/g; |
s/^[\t\s]+//; |
77 |
$r =~ s/\s+$//g; |
my ($l,$r) = split (/\s*:\s*/,$_,2); |
78 |
print "$l -> $r\n" if ($debug); |
if ($r) { |
79 |
$omni{$l} = $r; |
$l =~ s/\s+/_/g; |
80 |
|
$r =~ s/\s+$//g; |
81 |
|
print "$l -> $r\n" if ($debug); |
82 |
|
$omni{$l} = $r; |
83 |
|
} |
84 |
} |
} |
85 |
|
db(); |
86 |
|
close(O); |
87 |
} |
} |
|
db(); |
|
|
close(O); |
|