File Coverage

blib/lib/Net/Intermapper/Device.pm
Criterion Covered Total %
statement 18 119 15.1
branch 0 100 0.0
condition 0 8 0.0
subroutine 5 9 55.5
pod 4 4 100.0
total 27 240 11.2


line stmt bran cond sub pod time code
1             package Net::Intermapper::Device;
2 1     1   6 use strict;
  1         2  
  1         38  
3 1     1   5 use Moose;
  1         2  
  1         11  
4              
5             BEGIN {
6 1     1   6635 use Exporter ();
  1         2  
  1         31  
7 1     1   5 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS @HEADERS);
  1         2  
  1         195  
8 1     1   2 $VERSION = '0.04';
9 1         17 @ISA = qw(Exporter);
10 1         3 @EXPORT = qw();
11 1         2 @EXPORT_OK = qw();
12 1         2 %EXPORT_TAGS = ();
13            
14 1         2813 @HEADERS = qw(MapName MapPath Address Id Name Probe Comment Community DisplayIfUnNumbered DNSName IgnoreIfAppleTalk IgnoreIfDiscards IgnoreIfErrors IgnoreOutages AllowPeriodicProbe IMProbe Latitude Longtitude
15             LastTimeDown LastTimeSysUp LastTimeUp MACAddress MapAs MapId MaxTries NetBiosName PctLoss ShortTermPctLoss Availability PollInterval Port Resolve RoundTripTime SNMPv3AuthPassword SNMPv3AuthProtocol
16             SNMPv3PrivPassword SNMPv3PrivProtocol SNMPv3UserName SNMPVersion Status StatusLevel StatusLevelReason SysDescr SysName SysContact SysLocation SysObjectID TimeOut IMID Type ProbeXML SNMPVersionInt
17             SysServices EntServialNum EntMfgName EntModelName DataRetentionPolicy CustomerNameReference EnterpriseID DeviceKind SysUpTime LastModified Parent Acknowledge AckMessage AckExpiration AckTimer VertexID Layer2);
18              
19             };
20              
21             # MOOSE!
22              
23             # I'm lazy.. Yes, there were auto-generated!
24             has 'MapName' => (
25             is => 'rw',
26             isa => 'Str',
27             default => sub { "" },
28             );
29              
30             has 'MapPath' => (
31             is => 'rw',
32             isa => 'Str',
33             default => sub { "/" },
34             );
35              
36             has 'Address' => (
37             is => 'rw',
38             isa => 'Str',
39             default => sub { "" },
40             );
41              
42             has 'Id' => (
43             is => 'rw',
44             isa => 'Str',
45             default => sub { "" },
46             );
47              
48             has 'Name' => (
49             is => 'rw',
50             isa => 'Str',
51             default => sub { "" },
52             );
53              
54             has 'Probe' => (
55             is => 'rw',
56             isa => 'Str',
57             default => sub { "Ping/Echo" }, # SNMP Traffic
58             );
59              
60             has 'Comment' => (
61             is => 'rw',
62             isa => 'Str',
63             default => sub { "" },
64             );
65              
66             has 'Community' => (
67             is => 'rw',
68             isa => 'Str',
69             default => sub { "public" },
70             );
71              
72             has 'DisplayIfUnNumbered' => (
73             is => 'rw',
74             isa => 'Str',
75             default => sub { "false" },
76             );
77              
78             has 'DNSName' => (
79             is => 'rw',
80             isa => 'Str',
81             default => sub { "" },
82             );
83              
84             has 'IgnoreIfAppleTalk' => (
85             is => 'rw',
86             isa => 'Str',
87             default => sub { "" },
88             );
89              
90             has 'IgnoreIfDiscards' => (
91             is => 'rw',
92             isa => 'Str',
93             default => sub { "" },
94             );
95              
96             has 'IgnoreIfErrors' => (
97             is => 'rw',
98             isa => 'Str',
99             default => sub { "" },
100             );
101              
102             has 'IgnoreOutages' => (
103             is => 'rw',
104             isa => 'Str',
105             default => sub { "" },
106             );
107              
108             has 'AllowPeriodicProbe' => (
109             is => 'rw',
110             isa => 'Str',
111             default => sub { "" },
112             );
113              
114             has 'IMProbe' => (
115             is => 'rw',
116             isa => 'Str',
117             default => sub { "" },
118             );
119              
120             has 'Latitude' => (
121             is => 'rw',
122             isa => 'Str',
123             default => sub { "" },
124             );
125              
126             has 'Longtitude' => (
127             is => 'rw',
128             isa => 'Str',
129             default => sub { "" },
130             );
131              
132             has 'LastTimeDown' => (
133             is => 'rw',
134             isa => 'Str',
135             default => sub { "" },
136             );
137              
138             has 'LastTimeSysUp' => (
139             is => 'rw',
140             isa => 'Str',
141             default => sub { "" },
142             );
143              
144             has 'LastTimeUp' => (
145             is => 'rw',
146             isa => 'Str',
147             default => sub { "" },
148             );
149              
150             has 'MACAddress' => (
151             is => 'rw',
152             isa => 'Str',
153             default => sub { "" },
154             );
155              
156             has 'MapAs' => (
157             is => 'rw',
158             isa => 'Str',
159             default => sub { "" },
160             );
161              
162             has 'MapId,' => (
163             is => 'rw',
164             isa => 'Str',
165             default => sub { "" },
166             );
167              
168             has 'MaxTries' => (
169             is => 'rw',
170             isa => 'Str',
171             default => sub { "" },
172             );
173              
174             has 'NetBiosName' => (
175             is => 'rw',
176             isa => 'Str',
177             default => sub { "" },
178             );
179              
180             has 'PctLoss' => (
181             is => 'rw',
182             isa => 'Str',
183             default => sub { "" },
184             );
185              
186             has 'ShortTermPctLoss' => (
187             is => 'rw',
188             isa => 'Str',
189             default => sub { "" },
190             );
191              
192             has 'Availability' => (
193             is => 'rw',
194             isa => 'Str',
195             default => sub { "" },
196             );
197              
198             has 'PollInterval' => (
199             is => 'rw',
200             isa => 'Str',
201             default => sub { "" },
202             );
203              
204             has 'Port' => (
205             is => 'rw',
206             isa => 'Str',
207             default => sub { "" },
208             );
209              
210             has 'Resolve' => (
211             is => 'rw',
212             isa => 'Str',
213             default => sub { "" },
214             );
215              
216             has 'RoundTripTime' => (
217             is => 'rw',
218             isa => 'Str',
219             default => sub { "" },
220             );
221              
222             has 'SNMPv3AuthPassword' => (
223             is => 'rw',
224             isa => 'Str',
225             default => sub { "" },
226             );
227              
228             has 'SNMPv3AuthProtocol' => (
229             is => 'rw',
230             isa => 'Str',
231             default => sub { "" },
232             );
233              
234             has 'SNMPv3PrivPassword' => (
235             is => 'rw',
236             isa => 'Str',
237             default => sub { "" },
238             );
239              
240             has 'SNMPv3PrivProtocol' => (
241             is => 'rw',
242             isa => 'Str',
243             default => sub { "" },
244             );
245              
246             has 'SNMPv3UserName' => (
247             is => 'rw',
248             isa => 'Str',
249             default => sub { "" },
250             );
251              
252             has 'SNMPVersion' => (
253             is => 'rw',
254             isa => 'Str',
255             default => sub { "" },
256             );
257              
258             has 'Status' => (
259             is => 'rw',
260             isa => 'Str',
261             default => sub { "" },
262             );
263              
264             has 'StatusLevel' => (
265             is => 'rw',
266             isa => 'Str',
267             default => sub { "" },
268             );
269              
270             has 'StatusLevelReason' => (
271             is => 'rw',
272             isa => 'Str',
273             default => sub { "" },
274             );
275              
276             has 'SysDescr' => (
277             is => 'rw',
278             isa => 'Str',
279             default => sub { "" },
280             );
281              
282             has 'SysName' => (
283             is => 'rw',
284             isa => 'Str',
285             default => sub { "" },
286             );
287              
288             has 'SysContact' => (
289             is => 'rw',
290             isa => 'Str',
291             default => sub { "" },
292             );
293              
294             has 'SysLocation' => (
295             is => 'rw',
296             isa => 'Str',
297             default => sub { "" },
298             );
299              
300             has 'SysObjectID' => (
301             is => 'rw',
302             isa => 'Str',
303             default => sub { "" },
304             );
305              
306             has 'TimeOut' => (
307             is => 'rw',
308             isa => 'Str',
309             default => sub { "" },
310             );
311              
312             has 'IMID' => (
313             is => 'rw',
314             isa => 'Str',
315             default => sub { "" },
316             );
317              
318             has 'Type' => (
319             is => 'rw',
320             isa => 'Str',
321             default => sub { "" },
322             );
323              
324             has 'ProbeXML' => (
325             is => 'rw',
326             isa => 'Str',
327             default => sub { "" },
328             );
329              
330             has 'SNMPVersionInt' => (
331             is => 'rw',
332             isa => 'Str',
333             default => sub { "" },
334             );
335              
336             has 'SysServices' => (
337             is => 'rw',
338             isa => 'Str',
339             default => sub { "" },
340             );
341              
342             has 'EntServialNum' => (
343             is => 'rw',
344             isa => 'Str',
345             default => sub { "" },
346             );
347              
348             has 'EntMfgName' => (
349             is => 'rw',
350             isa => 'Str',
351             default => sub { "" },
352             );
353              
354             has 'EntModelName' => (
355             is => 'rw',
356             isa => 'Str',
357             default => sub { "" },
358             );
359              
360             has 'DataRetentionPolicy' => (
361             is => 'rw',
362             isa => 'Str',
363             default => sub { "" },
364             );
365              
366             has 'CustomerNameReference' => (
367             is => 'rw',
368             isa => 'Str',
369             default => sub { "" },
370             );
371              
372             has 'EnterpriseID' => (
373             is => 'rw',
374             isa => 'Str',
375             default => sub { "" },
376             );
377              
378             has 'DeviceKind' => (
379             is => 'rw',
380             isa => 'Str',
381             default => sub { "" },
382             );
383              
384             has 'SysUpTime' => (
385             is => 'rw',
386             isa => 'Str',
387             default => sub { "" },
388             );
389              
390             has 'LastModified' => (
391             is => 'rw',
392             isa => 'Str',
393             default => sub { "" },
394             );
395              
396             has 'Parent' => (
397             is => 'rw',
398             isa => 'Str',
399             default => sub { "" },
400             );
401              
402             has 'Acknowledge' => (
403             is => 'rw',
404             isa => 'Str',
405             default => sub { "" },
406             );
407              
408             has 'AckMessage' => (
409             is => 'rw',
410             isa => 'Str',
411             default => sub { "" },
412             );
413              
414             has 'AckExpiration' => (
415             is => 'rw',
416             isa => 'Str',
417             default => sub { "" },
418             );
419              
420             has 'AckTimer' => (
421             is => 'rw',
422             isa => 'Str',
423             default => sub { "" },
424             );
425              
426             has 'VertexID' => (
427             is => 'rw',
428             isa => 'Str',
429             default => sub { "" },
430             );
431              
432             has 'Layer2' => (
433             is => 'rw',
434             isa => 'Str',
435             default => sub { "" },
436             );
437              
438             has 'mode' => ( # create, update, delete
439             is => 'rw',
440             isa => 'Str',
441             default => sub { "create"; },
442             );
443            
444             # No Moose
445            
446             sub toXML
447 0     0 1   { my $self = shift;
448 0           my $id = shift;
449 0           my $result;
450             # Need to build the XML formatting!!
451 0 0         if ($id) { $result = " <id>$id</id>\n"; }
  0            
452 0           return $result;
453             }
454            
455             sub toCSV
456 0     0 1   { my $self = shift;
457 0           my $id = $self->Id;
458 0           my $result = "";
459 0           my @attributes = $self->meta->get_all_attributes;
460 0           my %attributes = ();
461 0           for my $attribute (@attributes)
462 0   0       { $attributes{$attribute->name} = $attribute->get_value($self) || "";
463             }
464 0           for my $key (@HEADERS)
465 0 0         { if ($self->mode eq "create")
466 0 0         { next if $key eq "Id";
467 0 0         next if $key eq "mode";
468 0 0         next if $key eq "LastTimeDown";
469 0 0         next if $key eq "LastTimeSysUp";
470 0 0         next if $key eq "LastTimeUp";
471 0 0         next unless $attributes{$key};
472 0           $result .= $attributes{$key}.",";
473             }
474 0 0         if ($self->mode eq "update")
475 0 0         { next if $key eq "mode";
476 0 0         next if $key eq "LastTimeDown";
477 0 0         next if $key eq "LastTimeSysUp";
478 0 0         next if $key eq "LastTimeUp";
479 0           $result .= $attributes{$key}.",";
480             }
481 0 0         if ($self->mode eq "delete")
482 0 0         { next if $key eq "mode";
483 0 0         next unless $attributes{$key};
484 0           $result .= $attributes{$key}.",";
485             }
486              
487             }
488 0           chop $result; # Remove the comma of the last field
489 0           $result =~ s/\s$//g;
490 0           $result .= "\r\n";
491 0           return $result;
492             }
493              
494             sub toTAB
495 0     0 1   { my $self = shift;
496 0           my $id = $self->Id;
497 0           my $result = "";
498 0           my @attributes = $self->meta->get_all_attributes;
499 0           my %attributes = ();
500 0           for my $attribute (@attributes)
501 0   0       { $attributes{$attribute->name} = $attribute->get_value($self) || "";
502             }
503 0           for my $key (@HEADERS)
504 0 0         { if ($self->mode eq "create")
505 0 0         { next if $key eq "Id";
506 0 0         next if $key eq "mode";
507 0 0         next if $key eq "MapId";
508 0 0         next if $key eq "LastTimeDown";
509 0 0         next if $key eq "LastTimeSysUp";
510 0 0         next if $key eq "LastTimeUp";
511 0 0         next unless $attributes{$key};
512 0           $result .= $attributes{$key}."\t";
513             }
514 0 0         if ($self->mode eq "update")
515 0 0         { next if $key eq "mode";
516 0 0         next unless $attributes{$key};
517 0           $result .= $attributes{$key}."\t";
518             }
519 0 0         if ($self->mode eq "delete")
520 0 0         { next if $key eq "mode";
521 0 0         next unless $attributes{$key};
522 0           $result .= $attributes{"Id"}."\t";
523 0           last;
524             }
525            
526             }
527 0           chop $result; # Remove the comma of the last field
528 0           $result =~ s/\s$//g;
529 0           $result .= "\r\n";
530 0           return $result;
531             }
532              
533             sub header
534 0     0 1   { my $self = shift;
535 0   0       my $format = shift || "";
536 0           my $header = "# format=$format table=devices fields=";
537 0           my @attributes = $self->meta->get_all_attributes;
538 0           my %attributes = ();
539 0           for my $attribute (@attributes)
540 0   0       { $attributes{$attribute->name} = $attribute->get_value($self) || "";
541             }
542 0           for my $key (@HEADERS)
543 0 0         { if ($self->mode eq "create")
544 0 0         { next if $key eq "Id";
545 0 0         next if $key eq "mode";
546 0 0         next if $key eq "LastTimeDown";
547 0 0         next if $key eq "LastTimeSysUp";
548 0 0         next if $key eq "LastTimeUp";
549 0 0         next unless $attributes{$key};
550 0           $header .= $key.",";
551             }
552 0 0         if ($self->mode eq "update")
553 0 0         { next if $key eq "LastTimeDown";
554 0 0         next if $key eq "LastTimeSysUp";
555 0 0         next if $key eq "LastTimeUp";
556 0 0         next if $key eq "mode";
557 0 0         next unless $attributes{$key};
558 0           $header .= $key.",";
559             }
560 0 0         if ($self->mode eq "delete")
561 0 0         { next if $key eq "LastTimeDown";
562 0 0         next if $key eq "LastTimeSysUp";
563 0 0         next if $key eq "LastTimeUp";
564 0 0         next if $key eq "mode";
565 0 0         next unless $attributes{$key};
566 0           $header .= $key.",";
567             }
568             }
569 0 0         if ($self->mode eq "delete")
570 0           { $header .= " delete=Id,Address,Name "; } # These 3 fields are used for filtering
571 0           chop $header;
572 0           $header .= "\r\n";
573 0           return $header;
574             }
575              
576            
577             =pod
578              
579             =head1 NAME
580              
581             Net::Intermapper::Device - Interface with the HelpSystems Intermapper HTTP API - Devices
582              
583             =head1 SYNOPSIS
584              
585             use Net::Intermapper;
586             my $intermapper = Net::Intermapper->new(hostname=>"10.0.0.1", username=>"admin", password=>"nmsadmin");
587             # Options:
588             # hostname - IP or hostname of Intermapper 5.x and 6.x server
589             # username - Username of Administrator user
590             # password - Password of user
591             # ssl - SSL enabled (1 - default) or disabled (0)
592             # port - TCP port for querying information. Defaults to 8181
593             # modifyport - TCP port for modifying information. Default to 443
594             # cache - Boolean to enable smart caching or force network queries
595              
596             my %users = $intermapper->users;
597             my $users_ref = $intermapper->users;
598             # Retrieve all users from Intermapper, Net::Intermapper::User instances
599             # Returns hash or hashref, depending on context
600            
601             my %devices = $intermapper->devices;
602             my $devices_ref = $intermapper->devices;
603             # Retrieve all devices from Intermapper, Net::Intermapper::Device instances
604             # Returns hash or hashref, depending on context
605              
606             my %maps = $intermapper->maps;
607             my $maps_ref = $intermapper->maps;
608             # Retrieve all maps from Intermapper, Net::Intermapper::Map instances
609             # Returns hash or hashref, depending on context
610              
611             my %interfaces = $intermapper->interfaces;
612             my $interfaces_ref = $intermapper->interfaces;
613             # Retrieve all interfaces from Intermapper, Net::Intermapper::Interface instances
614             # Returns hash or hashref, depending on context
615              
616             my %vertices = $intermapper->vertices;
617             my $vertices_ref = $intermapper->vertices;
618             # Retrieve all vertices from Intermapper, Net::Intermapper::Vertice instances
619             # Returns hash or hashref, depending on context
620              
621             my $user = $intermapper->users->{"admin"};
622            
623             # Each class will generate specific header. These are typically only for internal use but are compliant to the import format Intermapper uses.
624             print $user->header;
625             print $device->header;
626             print $map->header;
627             print $interface->header;
628             print $vertice->header;
629              
630             print $user->toTAB;
631             print $device->toXML; # This one is broken still!
632             print $map->toCSV;
633             # Works on ALL subclasses
634             # Produce human-readable output of each record in the formats Intermapper supports
635            
636             my $user = Net::Intermapper::User->new(Name=>"testuser", Password=>"Test12345");
637             my $response = $intermapper->create($user);
638             # Create new user
639             # Return value is HTTP::Response object
640            
641             my $device = Net::Intermapper::Device->new(Name=>"testDevice", MapName=>"TestMap", MapPath=>"/TestMap", Address=>"10.0.0.1");
642             my $response = $intermapper->create($device);
643             # Create new device
644             # Return value is HTTP::Response object
645              
646             $user->Password("Foobar123");
647             my $response = $intermapper->update($user);
648             # Update existing user
649             # Return value is HTTP::Response object
650              
651             my $user = $intermapper->users->{"bob"};
652             my $response = $intermapper->delete($user);
653             # Delete existing user
654             # Return value is HTTP::Response object
655              
656             my $device = $intermapper->devices->{"UniqueDeviceID"};
657             my $response = $intermapper->delete($device);
658             # Delete existing device
659             # Return value is HTTP::Response object
660              
661             my $users = { "Tom" => $tom_user, "Bob" => $bob_user };
662             $intermapper->users($users);
663             # At this point, there is no real reason to do this as update, create and delete work with explicit arguments.
664             # But it can be done with users, devices, interfaces, maps and vertices
665             # Pass a hashref to each method. This will NOT affect the smart-caching (only explicit calls to create, update and delete do this - for now).
666            
667             =head1 DESCRIPTION
668              
669             Net::Intermapper::Device is a perl wrapper around the HelpSystems Intermapper API provided through HTTP/HTTPS for access to device information.
670              
671             All calls are handled through an instance of the L<Net::Intermapper> class.
672              
673             use Net::Intermapper;
674             my $intermapper = Net::Intermapper->new(hostname => '10.0.0.1', username => 'admin', password => 'nmsadmin');
675              
676             =head1 USAGE
677              
678             =over 3
679              
680             =item new
681              
682             Class constructor. Returns object of Net::Intermapper::Device on succes. Attributes are:
683              
684             =over 5
685              
686             =item MapName (read-only)
687              
688             Name of the map containing the device.
689              
690             =item MapPath (read-only)
691              
692             Full path of the map containing the device, including the name of the map.
693              
694             =item Address (read-write)
695              
696             The IP or AppleTalk address of the device that is probed by InterMapper. The IP address is represented in dotted-decimal notation, e.g. 'a.b.c.d'. The AppleTalk address is represented in slash notation, e.g. 'a/b'.
697              
698             =item Id (read-only)
699              
700             A unique, persistent identifier for this device instance. The Id will be unique across all maps on a single InterMapper server. This value is used for lookups in the C<users> method in L<Net::Intermapper>.
701              
702             =item Name (read-only)
703              
704             The name of the device. The name is the first non-empty line in a device's label on a map.
705              
706             =item Probe (read-write)
707              
708             The human-readable name of the InterMapper probe.
709              
710             =item Comment (read-write)
711              
712             The comment associated with the device.
713              
714             =item Community (read-write)
715              
716             The SNMP community of the device.
717              
718             =item DisplayIfUnNumbered (read-write)
719              
720             True if the device's behaviour is set to display unnumbered interfaces.
721              
722             =item DNSName (read-write)
723              
724             The fully-qualified DNS name of the device.
725              
726             =item IgnoreIfAppleTalk (read-write)
727              
728             True if the device's behaviour is to ignore AppleTalk interface information.
729              
730             =item IgnoreIfDiscards (read-write)
731              
732             True if the device's behaviour is to ignore interface discards.
733              
734             =item IgnoreIfErrors (read-write)
735              
736             True if the device's behaviour is to ignore interface errors.
737              
738             =item IgnoreOutages (read-write)
739              
740             True if the device's behaviour is to ignore outages.
741              
742             =item AllowPeriodicReprobe (read-write)
743              
744             True if the device's behaviour is to allow periodic reprobe.
745              
746             =item IMProbe (read-write)
747              
748             A special URL representation describing the InterMapper probe and its parameters, e.g. improbe://address:port/...
749              
750             =item Latitude (read-write)
751              
752             The latitude of the device. The value will be a double within the range [-90..90] or empty string if the device does not have this attribute set.
753              
754             =item Longitude (read-write)
755              
756             The longitude of the device. The value will be a double within the range [-180..180] or empty string if the device does not have this attribute set.
757              
758             =item LastTimeDown (read-only)
759              
760             The time when the device last went down. Value is 0 if device has not gone down since we started monitoring it.
761              
762             =item LastTimeSysUp (read-only)
763              
764             The time when the device last came up (ie rebooted), based on the value of sysUpTime. The value is 0 if unknown.
765              
766             =item LastTimeUp (read-only)
767              
768             The time when the device status last transitioned from DOWN to UP. Value is 0 if this has not happened since we started monitoring.
769              
770             =item MACAddress (read-only)
771              
772             The device's MAC Address. If the device has multiple interfaces, this field will contain the MAC Address associated with the device's main IP Address (the same address in the address field).
773              
774             =item MapAs (read-write)
775              
776             Value is one of { ROUTER , SWITCH , HUB, END SYSTEM }
777              
778             =item MapId (read-only)
779              
780             The unique Id of the map file containing the device.
781              
782             =item MaxTries (read-write)
783              
784             The maximum number of attempts to reach the device, typically indicates the maximum number of packets to send during each poll, for packet-based probes.
785              
786             =item NetBIOSName (read-write)
787              
788             The NetBIOS/WINS name of the device.
789              
790             =item PctLoss (read-only)
791              
792             The percent loss (# packets lost/total # packets sent).
793              
794             =item ShortTermPctLoss (read-only)
795              
796             The short-term percent loss (# packets lost/# packets sent).
797              
798             =item Availability (read-only)
799              
800             The percent availability (time up/time monitored).
801              
802             =item PollInterval (read-write)
803              
804             The poll interval of the device, in seconds. Value is 0 if non-polling.
805              
806             =item Port (read-write)
807              
808             The UDP or TCP port number. If the port number is not applicable, this value is always 0. (e.g. for ICMP)
809              
810             =item Resolve (read-write)
811              
812             Value is one of { name , addr , none }.
813              
814             =item RoundTripTime (read-only)
815              
816             The last round-trip time in milliseconds, if known.
817              
818             =item SNMPv3AuthPassword (read-write)
819              
820             The device's SNMPv3 authentication password.
821              
822             =item SNMPv3AuthProtocol (read-write)
823              
824             The device's SNMPv3 authentication protocol (MD5, SHA, None).
825              
826             =item SNMPv3PrivPassword (read-write)
827              
828             The device's SNMPv3 privacy password.
829              
830             =item SNMPv3PrivProtocol (read-write)
831              
832             The device's SNMPv3 privacy protocol (DES, None).
833              
834             =item SNMPv3UserName (read-write)
835              
836             The device's SNMPv3 user name.
837              
838             =item SNMPVersion (read-write)
839              
840             The device's SNMP version (SNMPv1, SNMPv2c, or SNMPv3).
841              
842             =item Status (read-only)
843              
844             The status of the device. The value is one of { 'UP', 'DOWN', 'UNKNOWN' }.
845              
846             =item StatusLevel (read-only)
847              
848             The status level of the device. The value is one of { 'Unknown', 'OK', 'Warning, Acked', 'Warning', 'Alarm, Acked', 'Alarm', 'Critical', 'Critical, Acked', 'Down', 'Down, Acked'}.
849              
850             =item StatusLevelReason (read-only)
851              
852             The reason the device has its status level.
853              
854             =item SysDescr (read-only)
855              
856             The value of sysDescr.
857              
858             =item SysName (read-only)
859              
860             The value of sysName.
861              
862             =item SysContact (read-only)
863              
864             The value of sysContact.
865              
866             =item SysLocation (read-only)
867              
868             The value of sysLocation.
869              
870             =item SysObjectID (read-only)
871              
872             The value of sysObjectID.
873              
874             =item TimeOut (read-write)
875              
876             The timeout of the device, in seconds. Value is 0 if not-applicable to the probe.
877              
878             =item IMID (read-only)
879              
880             Identifier of the device in the IMID format.
881              
882             =item Type (read-only)
883              
884             One of { none, other, snmp, tcp, udp, icmp, cmd, bigbro, ntsvcs }. These values have been updated in 5.0 to match the values used by the database in the probekind field of the devices table.
885              
886             =item ProbeXML (read-only)
887              
888             XML dataset DTD, type='probe'.
889              
890             =item SNMPVersionInt (read-only)
891              
892             1, 2, 3 - SNMP versions. 0 for non-SNMP.
893              
894             =item SysServices (read-only)
895              
896             16-bits integer.
897              
898             =item EntSerialNum (read-only)
899              
900             SnmpAdminString (entPhysicalSerialNum of chassis).
901              
902             =item EntMfgName (read-only)
903              
904             SnmpAdminString (entPhysicalMfgName of chassis).
905              
906             =item EntModelName (read-only)
907              
908             SnmpAdminString (entPhysicalModelName of chassis).
909              
910             =item DataRetentionPolicy (read-only)
911              
912             Data retention policy for IM Database
913              
914             =item CustomerNameReference (read-only)
915              
916             Customer-supplied device name reference, for linking to an external database.
917              
918             =item EnterpriseID (read-only)
919              
920             The value of sysEnterpriseID.
921              
922             =item DeviceKind (read-only)
923              
924             User-specified device type.
925              
926             =item SysUpTime (read-only)
927              
928             System uptime.
929              
930             =item LastModified (read-only)
931              
932             Timestamp of last modification to this device.
933              
934             =item Parent (read-only)
935              
936             Device ID of the parent probe group; this device's id if this device is a probe group; 0 if the device is not part of a probe group.
937              
938             =item Acknowledge (read-write)
939              
940             The acknowledgement state of the device; one of { 'None', 'Basic', 'Maintenance' }. The AckMessage field must also be set to import this field. Indefinite maintenance will be set if AckExpiration is missing and state is set to 'Maintenance'.
941              
942             =item AckMessage (read-write)
943              
944             The message associated with the acknowledge state. If Acknowledge is not set and an AckMessage is supplied, Acknowledge will be set to 'Basic'.
945              
946             =item AckExpiration (read-write)
947              
948             The absolute time when the timed acknowledgement expires, if any. The AckMessage field must also be set to import this field. Acknowledge will be set to 'Maintenance' if not supplied.
949              
950             =item AckTimer (read-only)
951              
952             The time in seconds remaining until the timed acknowledgement expires, if any.
953              
954             =item VertexId (read-only)
955              
956             The Vertex Id of the vertex associated with the device. Matches the VertexId of the corresponding vertex in the vertices table.
957              
958             =item Layer2 (read-only)
959              
960             True if layer2 mapping is enabled for this device.
961              
962             =back
963              
964             =over 3
965              
966             =item header
967              
968             Returns the C<directive> aka data header required by the Intermapper API to perform CRUD actions. This is handled through the C<create>, C<update> and C<delete> method and should not really be used.
969              
970             =back
971              
972             =over 3
973              
974             =item toTAB
975              
976             Returns the object data formatted in TAB delimited format. Used in combination with the C<header> and the C<format> method in L<Net::Intermapper> to perform CRUD actions. This is handled through the C<create>, C<update> and C<delete> method and should not really be used.
977              
978             =back
979              
980             =over 3
981              
982             =item toCSV
983              
984             Returns the object data formatted in Comma Separated delimited format. Used in combination with the C<header> and the C<format> method in L<Net::Intermapper> to perform CRUD actions. This is handled through the C<create>, C<update> and C<delete> method and should not really be used.
985              
986             =back
987              
988             =over 3
989              
990             =item toXML
991              
992             Returns the object data formatted in XML format. Used in combination with the C<header> and the C<format> method in L<Net::Intermapper> to perform CRUD actions. This is handled through the C<create>, C<update> and C<delete> method and should not really be used.
993              
994             =back
995              
996             =over 3
997              
998             =item mode
999              
1000             Internal method to properly format the data and header for CRUD actions. Typically not used.
1001              
1002             =back
1003              
1004             =item $ERROR
1005              
1006             NEEDS TO BE ADDED
1007              
1008             This variable will contain detailed error information.
1009            
1010             =back
1011              
1012             =head1 REQUIREMENTS
1013              
1014             For this library to work, you need an instance with Intermapper (obviously) or a simulator like L<Net::Intermapper::Mock>.
1015              
1016             =over 3
1017              
1018             =item L<Moose>
1019              
1020             =item L<IO::Socket::SSL>
1021              
1022             =item L<LWP::UserAgent>
1023              
1024             =item L<XML::Simple>
1025              
1026             =item L<MIME::Base64>
1027              
1028             =item L<URI::Escape>
1029              
1030             =item L<Text::CSV_XS>
1031              
1032             =back
1033            
1034             =head1 BUGS
1035              
1036             None so far
1037              
1038             =head1 SUPPORT
1039              
1040             None so far :)
1041              
1042             =head1 AUTHOR
1043              
1044             Hendrik Van Belleghem
1045             CPAN ID: BEATNIK
1046             hendrik.vanbelleghem@gmail.com
1047              
1048             =head1 COPYRIGHT
1049              
1050             This program is free software licensed under the...
1051              
1052             The General Public License (GPL)
1053             Version 2, June 1991
1054              
1055             The full text of the license can be found in the
1056             LICENSE file included with this module.
1057              
1058              
1059             =head1 SEE ALSO
1060              
1061             L<http://download.intermapper.com/docs/UserGuide/Content/09-Reference/09-05-Advanced_Importing/the_directive_line.htm>
1062             L<http://download.intermapper.com/schema/imserverschema.html>
1063              
1064             =cut
1065              
1066             #################### main pod documentation end ###################
1067              
1068             __PACKAGE__->meta->make_immutable();
1069              
1070             1;
1071             # The preceding line will help the module return a true value
1072