mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-8617-plugin-openstack-problema-con-hypervisores-2' into 'develop'
Adding openstack plugin See merge request artica/pandorafms!4891
This commit is contained in:
commit
4ae4f6b7bd
@ -469,6 +469,11 @@ sub parse_log ($$$$$$$$) {
|
||||
# Go to starting position
|
||||
seek(LOGFILE, $Idx_pos, 0);
|
||||
|
||||
if ($type eq "log_module"){
|
||||
$buffer = "<log_module>\n";
|
||||
$buffer .= "<source><![CDATA[" . $Module_name . "]]></source>\n";
|
||||
$buffer .= "<data><![CDATA[";
|
||||
} else {
|
||||
$buffer .= "<module>\n";
|
||||
$buffer .= "<name><![CDATA[" . $Module_name . "]]></name>\n";
|
||||
$buffer .= "<description><![CDATA[" . $Description . "]]></description>\n";
|
||||
@ -479,6 +484,7 @@ sub parse_log ($$$$$$$$) {
|
||||
$buffer .= "<type><![CDATA[async_string]]></type>\n";
|
||||
$buffer .= "<datalist>\n";
|
||||
}
|
||||
}
|
||||
|
||||
while ($line = <LOGFILE>) {
|
||||
while (my ($key, $value) = each (%{$regexp_collection})) {
|
||||
@ -503,6 +509,11 @@ sub parse_log ($$$$$$$$) {
|
||||
$buffer .= "<data><value><![CDATA[".$line."]]></value></data>\n";
|
||||
}
|
||||
|
||||
if ($type eq "log_module") {
|
||||
$line =~ s/\]\]/]]]]><![CDATA[/g;
|
||||
$buffer .= $line."\n";
|
||||
}
|
||||
|
||||
# Critical severity will prevail over other matches
|
||||
if ($severity eq ""){
|
||||
$severity = $value->{"severity"};
|
||||
@ -515,18 +526,20 @@ sub parse_log ($$$$$$$$) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($type ne "log_module"){
|
||||
if ($type eq "return_ocurrences"){
|
||||
$buffer .= "<data><![CDATA[".$count."]]></data>\n";
|
||||
} else {
|
||||
$buffer .= "</datalist>\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Execute action if any match (always for last match)
|
||||
if ($count > 0){
|
||||
`$action`;
|
||||
}
|
||||
|
||||
if ($type ne "log_module"){
|
||||
# Write severity field in XML
|
||||
if ($severity ne ""){
|
||||
$buffer .= "<status>$severity</status>\n";
|
||||
@ -534,6 +547,10 @@ sub parse_log ($$$$$$$$) {
|
||||
|
||||
# End XML
|
||||
$buffer .= "</module>\n";
|
||||
}else {
|
||||
$buffer .= "]]></data>\n";
|
||||
$buffer .= "</log_module>\n";
|
||||
}
|
||||
|
||||
# Update Index
|
||||
$Idx_pos = tell(LOGFILE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user