I’m running into issues because of carriage returns and need some assistance…
I’m using this to capture the description:
-------------------------------------------------------------------------------------
my $description = '';
if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/m) {
$description = $1;
}
-------------------------------------------------------------------------------------
That works fine as long as the description is a single line – it captures nothing if it goes to a new one.
It captures this description fine:
-------------------------------------------------------------------------------------
topology OBJECT IDENTIFIER ::= { directorFamily 1 }
online NOTIFICATION-TYPE
OBJECTS { trapType, trapSeverity, trapSenderName, trapManagedObjectName, trapText, trapCategory }
STATUS current
DESCRIPTION
"The managed object's state has changed to online."
::= { topology 1 }
-------------------------------------------------------------------------------------
This one dies:
-------------------------------------------------------------------------------------
processMonitor NOTIFICATION-TYPE
OBJECTS { trapType, trapSeverity, trapSenderName, trapManagedObjectName, trapText, trapCategory,
actualValue, duration, monitorResource, thresholdName, thresholdValue }
STATUS current
DESCRIPTION
"The process monitor threshold has generated
an event."
::= { directorAgent 1 }
-------------------------------------------------------------------------------------
Any ideas? All I'm trying to do is capture the text in between the quotes...
Thanks for the help!
I’m using this to capture the description:
-------------------------------------------------------------------------------------
my $description = '';
if ($record =~ /^\s+DESCRIPTION\n\s+"(.*?)"$/m) {
$description = $1;
}
-------------------------------------------------------------------------------------
That works fine as long as the description is a single line – it captures nothing if it goes to a new one.
It captures this description fine:
-------------------------------------------------------------------------------------
topology OBJECT IDENTIFIER ::= { directorFamily 1 }
online NOTIFICATION-TYPE
OBJECTS { trapType, trapSeverity, trapSenderName, trapManagedObjectName, trapText, trapCategory }
STATUS current
DESCRIPTION
"The managed object's state has changed to online."
::= { topology 1 }
-------------------------------------------------------------------------------------
This one dies:
-------------------------------------------------------------------------------------
processMonitor NOTIFICATION-TYPE
OBJECTS { trapType, trapSeverity, trapSenderName, trapManagedObjectName, trapText, trapCategory,
actualValue, duration, monitorResource, thresholdName, thresholdValue }
STATUS current
DESCRIPTION
"The process monitor threshold has generated
an event."
::= { directorAgent 1 }
-------------------------------------------------------------------------------------
Any ideas? All I'm trying to do is capture the text in between the quotes...
Thanks for the help!