Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

snmp: Add a version string to SNMP traps.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
  • Loading branch information...
commit 4b98461f41b0d700751760dc24376a9b21db461c 1 parent b9beaa7
Jesper Dangaard Brouer authored
View
16 collector/lib/IPTV/Analyzer/snmptrap.pm
@@ -23,6 +23,7 @@ use Log::Log4perl qw(get_logger :levels);
our $logger = get_logger(__PACKAGE__);
use IPTV::Analyzer::Config;
+use IPTV::Analyzer::Version;
BEGIN {
use Exporter ();
@@ -107,6 +108,17 @@ sub construct_input_identification($)
return @array;
}
+sub construct_version()
+{
+ my $version = $IPTV::Analyzer::Version::VERSION || "0.0.0";
+ my @array = (
+ # collectorsVersion
+ '1.3.6.1.4.1.26124.43.2.1.4.1', OCTET_STRING, $version,
+ );
+ return @array;
+}
+
+
sub construct_probe_identification()
{
my $cfg = get_config();
@@ -205,6 +217,9 @@ sub send_snmptrap($$$$$$)
my $trap = lookup_trap($event_name);
my @trap_oid = construct_trap_oid($trap, $timeticks);
+ # The collectornVersion info
+ my @version = construct_version();
+
# The event type
my @event_oids = construct_event_via_name($event_name, $severity_name);
@@ -219,6 +234,7 @@ sub send_snmptrap($$$$$$)
my @oid_array =
(
@trap_oid,
+ @version,
@ident_probe,
@event_oids,
View
23 snmp/mibs/IPTV-ANALYZER-MIB.txt
@@ -194,6 +194,27 @@ collectorInput OBJECT IDENTIFIER ::= { collectorTrapControl 3 }
-- 1.3.6.1.4.1.26124.43.2.1.3.3
::= { collectorInput 3 }
+-- Sub divide: collector information
+collectorInfo OBJECT IDENTIFIER ::= { collectorTrapControl 4 }
+-- 1.3.6.1.4.1.26124.43.2.1.4
+
+ collectorVersion OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The version of the IPTV-collector."
+ -- 1.3.6.1.4.1.26124.43.2.1.4.1
+ ::= { collectorInfo 1 }
+
+ mpeg2tsVersion OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The version of the mpeg2ts kernel module."
+ -- 1.3.6.1.4.1.26124.43.2.1.4.2
+ ::= { collectorInfo 2 }
--
-- Traps
@@ -204,6 +225,7 @@ collectorTraps OBJECT IDENTIFIER ::= { iptvAnalyzerTrap 2 }
generalEvent NOTIFICATION-TYPE
OBJECTS {
+ collectorVersion,
collectorId, -- The originator of the trap
collectorName,
eventType, -- The event type
@@ -218,6 +240,7 @@ collectorTraps OBJECT IDENTIFIER ::= { iptvAnalyzerTrap 2 }
streamNoSignal NOTIFICATION-TYPE
OBJECTS {
+ collectorVersion,
collectorId, -- The originator of the trap
collectorName,
eventType, -- Event type: noSignal(4)
Please sign in to comment.
Something went wrong with that request. Please try again.