Send Netdot-devel mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."


Today's Topics:

   1. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.4-85-g61d5ca0 ([email protected])
   2. [SCM] Netdot branch master updated.       netdot-1.0.4-85-g61d5ca0
      ([email protected])
   3. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.4-87-g545b240 ([email protected])
   4. [SCM] Netdot branch netdot-1.0 updated.
      netdot-1.0.4-88-gdc5eddb ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Wed, 31 Jul 2013 14:21:44 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.4-85-g61d5ca0
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, netdot-1.0 has been updated
       via  61d5ca06022f0b81960b171d074c1ee92c9c5441 (commit)
      from  69c9f1b33c7d633735aadd859403fbf559d60311 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 61d5ca06022f0b81960b171d074c1ee92c9c5441
Author: Carlos Vicente <[email protected]>
Date:   Wed Jul 31 17:19:56 2013 -0400

    Fix several issues with cacti exports:
    
    - Add missing library for dealing with tree objects
    - Pass SNMPv3-specific parameters to Cacti
    - Fix broken selection of 32 vs 64 bit counters for interfaces

diff --git a/export/cacti/netdot_to_cacti.php b/export/cacti/netdot_to_cacti.php
index ac1742e..587d1af 100644
--- a/export/cacti/netdot_to_cacti.php
+++ b/export/cacti/netdot_to_cacti.php
@@ -26,6 +26,7 @@ include_once($config["base_path"]."/lib/snmp.php");
 include_once($config["base_path"]."/lib/data_query.php");
 include_once($config["base_path"]."/lib/api_device.php");
 include_once($config["base_path"]."/lib/api_tree.php");
+include_once($config["base_path"].'/lib/tree.php');
 
 /* process calling arguments */
 $parms = $_SERVER["argv"];
@@ -90,8 +91,10 @@ if (!$result) {
 
 $q = $netdot_db->Execute("
                 SELECT     rr.name, zone.name, ipblock.address, site.name, 
p.name, p.sysobjectid, pt.name, 
-                           d.id, d.snmp_managed, d.snmp_polling, d.community, 
d.snmp_version, e.name, m.name 
-                FROM      asset a, rr, zone, producttype pt, device d
+                           d.id, d.snmp_managed, d.snmp_polling, d.community, 
d.snmp_version, 
+                           d.snmp_authkey, d.snmp_authprotocol, 
d.snmp_privkey, d.snmp_privprotocol,
+                           d.snmp_securityname, e.name, m.name 
+                FROM       asset a, rr, zone, producttype pt, device d
                 LEFT JOIN (site) ON (d.site=site.id)
                 LEFT JOIN (ipblock) ON (d.snmp_target=ipblock.id)
                 LEFT JOIN (entity e) ON (d.used_by=e.id),
@@ -112,7 +115,9 @@ if (!$q) {
 
 while ($row = $q->FetchRow()) {
   list($name, $domain, $iaddress, $site, $product, $sysobjectid, $ptype, 
-       $netdot_id, $managed, $enabled, $community, $version, $used_by, $mfg) = 
$row; 
+       $netdot_id, $managed, $enabled, $community, $snmp_version, 
+       $snmp_password, $snmp_auth_protocol, $snmp_priv_passphrase, 
$snmp_priv_protocol, 
+       $snmp_username, $used_by, $mfg) = $row; 
 
   if (!$managed) {
     continue;
@@ -141,8 +146,8 @@ while ($row = $q->FetchRow()) {
   if (!$ptype){
     $ptype = 'unknown';
   }
-  if (!$version){
-    $version = 2;
+  if (!$snmp_version){
+    $snmp_version = 2;
   }
   if (!$community){
     $community = "public";
@@ -191,12 +196,17 @@ while ($row = $q->FetchRow()) {
 
   $community = trim($community);
 
-  $groups[$group][$host]["netdot_id"]   = $netdot_id;
-  $groups[$group][$host]["ip"]          = $address;
-  $groups[$group][$host]["template_id"] = $template_id;
-  $groups[$group][$host]["disable"]     = $disable;
-  $groups[$group][$host]["snmp_ver"]    = $version;
-  $groups[$group][$host]["community"]   = $community;
+  $groups[$group][$host]["netdot_id"]             = $netdot_id;
+  $groups[$group][$host]["ip"]                    = $address;
+  $groups[$group][$host]["template_id"]           = $template_id;
+  $groups[$group][$host]["disable"]               = $disable;
+  $groups[$group][$host]["snmp_version"]          = $snmp_version;
+  $groups[$group][$host]["snmp_username"]         = $snmp_username;
+  $groups[$group][$host]["snmp_password"]         = $snmp_password;
+  $groups[$group][$host]["snmp_auth_protocol"]    = $snmp_auth_protocol;
+  $groups[$group][$host]["snmp_priv_passphrase"]  = $snmp_priv_passphrase;
+  $groups[$group][$host]["snmp_priv_protocol"]    = $snmp_priv_protocol;
+  $groups[$group][$host]["community"]             = $community;
 
  }
 
@@ -243,12 +253,17 @@ foreach ($groups as $group => $hosts){
   }
 
   foreach ($hosts as $description => $attr){
-    $netdot_id   = $attr["netdot_id"];
-    $ip          = $attr["ip"];
-    $template_id = $attr["template_id"];
-    $disable     = $attr["disable"];
-    $snmp_ver    = $attr["snmp_ver"];
-    $community   = $attr["community"];
+    $netdot_id            = $attr["netdot_id"];
+    $ip                   = $attr["ip"];
+    $template_id          = $attr["template_id"];
+    $disable              = $attr["disable"];
+    $snmp_version         = $attr["snmp_version"];
+    $snmp_username        = $attr["snmp_username"];
+    $snmp_password        = $attr["snmp_password"];
+    $snmp_auth_protocol   = $attr["snmp_auth_protocol"];
+    $snmp_priv_passphrase = $attr["snmp_priv_passphrase"];
+    $snmp_priv_protocol   = $attr["snmp_priv_protocol"];
+    $community            = $attr["community"];
     
     $hostId = 0;
     
@@ -274,8 +289,8 @@ foreach ($groups as $group => $hosts){
     }
 
     /* validate snmp version */
-    if ($snmp_ver != "1" && $snmp_ver != "2" && $snmp_ver != "3") {
-      echo "ERROR: Invalid snmp version ($snmp_ver)\n";
+    if ($snmp_version != "1" && $snmp_version != "2" && $snmp_version != "3") {
+      echo "ERROR: Invalid snmp version ($snmp_version)\n";
       exit(1);
     }
 
@@ -296,7 +311,7 @@ foreach ($groups as $group => $hosts){
     /* Add or Update Device */
 
     if ($hostId){
-      debug("$description: Updating device id $hostId ($description) template 
\"" . $hostTemplates[$template_id] . "\" using SNMP v$snmp_ver with community 
\"$community\"");
+      debug("$description: Updating device id $hostId ($description) template 
\"" . $hostTemplates[$template_id] . "\" using SNMP v$snmp_version");
     }else{
 
       /* Do not bother creating device if it is disabled */
@@ -304,10 +319,10 @@ foreach ($groups as $group => $hosts){
        continue;
       }
       
-      echo "$description: Adding device ($description) template \"" . 
$hostTemplates[$template_id] . "\" using SNMP v$snmp_ver with community 
\"$community\"\n";
+      echo "$description: Adding device ($description) template \"" . 
$hostTemplates[$template_id] . "\" using SNMP v$snmp_version\n";
     }
     $hostId = api_device_save($hostId, $template_id, $description, $ip,
-                             $community, $snmp_ver, $snmp_username, 
$snmp_password,
+                             $community, $snmp_version, $snmp_username, 
$snmp_password,
                              $snmp_port, $snmp_timeout, $disable, $avail, 
$ping_method,
                              $ping_port, $ping_timeout, $ping_retries, $notes,
                              $snmp_auth_protocol, $snmp_priv_passphrase,
diff --git a/export/cacti/netdot_to_cacti_config.php 
b/export/cacti/netdot_to_cacti_config.php
index 4d2a89d..d23dea4 100644
--- a/export/cacti/netdot_to_cacti_config.php
+++ b/export/cacti/netdot_to_cacti_config.php
@@ -83,27 +83,25 @@ $hostGroupStyle = 2;    /* 1 = Graph Template,  2 = Data 
Query Index */
 /* 
----------------------------------------------------------------------------------
 */
 /* SNMP - Interface Statistics 
 */
-$dsGraphs["any"]["Interface Statistics"]["snmpQueryId"] = 1;
 
-/* 
-Select a subset of the interfaces:
-*/
-$dsGraphs["any"]["Interface Statistics"]["snmpCriteria"] = 
"field_name='ifSpeed' AND field_value<='100000000'";
-
-$dsGraphs["any"]["Interface Statistics"]["queryTypeIds"] = array(2  => 22,  // 
In/Out Errors/Discarded Packets
-                                                                3  => 24,  // 
In/Out Non-Unicast Packets
-                                                                4  => 23,  // 
In/Out Unicast Packets
-                                                                13 => 2,   // 
In/Out Bits
-                                                                );
 
 $dsGraphs["any"]["64-bit Interface Statistics"]["snmpQueryId"]  = 1;
-$dsGraphs["any"]["64-bit Interface Statistics"]["snmpCriteria"] = 
"field_name='ifSpeed' AND field_value>'100000000'";
+$dsGraphs["any"]["64-bit Interface Statistics"]["snmpCriteria"] = 
"field_name='ifHighSpeed' ";
 $dsGraphs["any"]["64-bit Interface Statistics"]["queryTypeIds"] = array(2  => 
22,  // In/Out Errors/Discarded Packets
                                                                        3  => 
24,  // In/Out Non-Unicast Packets
                                                                        4  => 
23,  // In/Out Unicast Packets
                                                                        14 => 
2,   // In/Out Bits (64-bit Counters)
                                                                        );
 
+// Here, the plan is that if the above criteria isn't met, then these graphs 
will be created instead
+// Tests so far indicate that both types of graphs will not be created for the 
same host
+$dsGraphs["any"]["Interface Statistics"]["snmpQueryId"] = 1;
+$dsGraphs["any"]["Interface Statistics"]["snmpCriteria"] = 
"field_name='ifSpeed'";
+$dsGraphs["any"]["Interface Statistics"]["queryTypeIds"] = array(2  => 22,  // 
In/Out Errors/Discarded Packets
+                                                                3  => 24,  // 
In/Out Non-Unicast Packets
+                                                                4  => 23,  // 
In/Out Unicast Packets
+                                                                13 => 2,   // 
In/Out Bits
+                                                                );
 /* Host MIB Mounted Partitions Stats */
 $dsGraphs["3"]["Mounted Partitions"]["snmpQueryId"]  = 8;
 $dsGraphs["3"]["Mounted Partitions"]["snmpCriteria"] = 
"field_name='hrStorageIndex'";

-----------------------------------------------------------------------

Summary of changes:
 export/cacti/netdot_to_cacti.php        |   59 +++++++++++++++++++-----------
 export/cacti/netdot_to_cacti_config.php |   22 +++++------
 2 files changed, 47 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 2
Date: Wed, 31 Jul 2013 14:22:33 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch master updated.
        netdot-1.0.4-85-g61d5ca0
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, master has been updated
       via  61d5ca06022f0b81960b171d074c1ee92c9c5441 (commit)
      from  69c9f1b33c7d633735aadd859403fbf559d60311 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 export/cacti/netdot_to_cacti.php        |   59 +++++++++++++++++++-----------
 export/cacti/netdot_to_cacti_config.php |   22 +++++------
 2 files changed, 47 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 3
Date: Wed, 31 Jul 2013 20:19:58 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.4-87-g545b240
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, netdot-1.0 has been updated
       via  545b240c359fd4f0bb2e015495437700bdef1e65 (commit)
       via  8c9f7a7fa1a8a1852c08267a0ed3b26583a6877a (commit)
      from  61d5ca06022f0b81960b171d074c1ee92c9c5441 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 545b240c359fd4f0bb2e015495437700bdef1e65
Author: Carlos Vicente <[email protected]>
Date:   Wed Jul 31 23:19:38 2013 -0400

    Satisfy new snmp_priv_protocol validation in Cacti 0.8.8

diff --git a/export/cacti/netdot_to_cacti.php b/export/cacti/netdot_to_cacti.php
index 587d1af..4ee1536 100644
--- a/export/cacti/netdot_to_cacti.php
+++ b/export/cacti/netdot_to_cacti.php
@@ -152,6 +152,10 @@ while ($row = $q->FetchRow()) {
   if (!$community){
     $community = "public";
   }
+  // This is a new requirement of api_device_save as of Cacti 0.8.8
+  if ($snmp_priv_protocol == 'AES'){
+    $snmp_priv_protocol = 'AES128';
+  }
   $disable = ($enabled)? 0 : 1;
   
   // Try to assign a template

commit 8c9f7a7fa1a8a1852c08267a0ed3b26583a6877a
Author: Carlos Vicente <[email protected]>
Date:   Wed Jul 31 18:04:26 2013 -0400

    Avoid Perl warning

diff --git a/lib/Netdot/Model/Interface.pm b/lib/Netdot/Model/Interface.pm
index a025903..526f521 100644
--- a/lib/Netdot/Model/Interface.pm
+++ b/lib/Netdot/Model/Interface.pm
@@ -682,7 +682,7 @@ sub update_ip {
                
                # Add description from interface if not set
                $iargs{description} = $self->description 
-                   if ( $subnetobj->description eq "" );
+                   if ( !defined $subnetobj->description || 
$subnetobj->description eq "" );
 
                $subnetobj->update(\%iargs); # Makes sure that the status is 
set to subnet
                

-----------------------------------------------------------------------

Summary of changes:
 export/cacti/netdot_to_cacti.php |    4 ++++
 lib/Netdot/Model/Interface.pm    |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Netdot


------------------------------

Message: 4
Date: Wed, 31 Jul 2013 20:22:57 -0700
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
        netdot-1.0.4-88-gdc5eddb
To: [email protected]
Message-ID: <[email protected]>

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Netdot".

The branch, netdot-1.0 has been updated
       via  dc5eddb8b26bcf66aa7032014908133adc23e033 (commit)
      from  545b240c359fd4f0bb2e015495437700bdef1e65 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dc5eddb8b26bcf66aa7032014908133adc23e033
Author: Carlos Vicente <[email protected]>
Date:   Wed Jul 31 23:22:44 2013 -0400

    Initialize USE_SNMP_QUERY_ENGINE variable in Default.conf. Default value is 
0 (disabled)

diff --git a/etc/Default.conf b/etc/Default.conf
index 8b8f1d8..7419ed2 100644
--- a/etc/Default.conf
+++ b/etc/Default.conf
@@ -223,6 +223,7 @@ SNMP_MIB_DIRS            =>  [ 'allied', 'arista', 'aruba', 
'asante',
 
 # Experimental: use snmp-query-engine for SNMP queries
 ## USE_SNMP_QUERY_ENGINE  => "127.0.0.1:7667",
+USE_SNMP_QUERY_ENGINE  => 0,
 
 # Some versions of the SNMP perl module are broken.
 # Enable this flag if you know your module has been patched

-----------------------------------------------------------------------

Summary of changes:
 etc/Default.conf |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Netdot


------------------------------

_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel


End of Netdot-devel Digest, Vol 77, Issue 1
*******************************************

Reply via email to