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-127-g57ebef0 ([email protected])
2. [SCM] Netdot branch netdot-1.0 updated.
netdot-1.0.4-128-g5083baa ([email protected])
----------------------------------------------------------------------
Message: 1
Date: Fri, 15 Nov 2013 12:28:40 -0800
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
netdot-1.0.4-127-g57ebef0
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 57ebef08e9e60b02ac66ee8699c88f84d8f56f43 (commit)
from 9ad91a5690ed85f9ee44858f8aa028aae232d091 (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 57ebef08e9e60b02ac66ee8699c88f84d8f56f43
Author: Carlos Vicente <[email protected]>
Date: Fri Nov 8 06:37:51 2013 -0500
Add parameter in netdot2cacti.php to only include a specific netdot device
(useful when testing)
diff --git a/export/cacti/netdot_to_cacti.php b/export/cacti/netdot_to_cacti.php
index be13b1d..855d098 100644
--- a/export/cacti/netdot_to_cacti.php
+++ b/export/cacti/netdot_to_cacti.php
@@ -53,6 +53,9 @@ array_shift($parms);
case "--no-graphs":
$no_graphs = TRUE;
break;
+ case "--id":
+ $id = $value;
+ break;
default:
echo "ERROR: Invalid Argument: ($arg)\n\n";
display_help();
@@ -89,8 +92,7 @@ if (!$result) {
exit(1);
}
-$q = $netdot_db->Execute("
- SELECT rr.name, zone.name, ipblock.address, site.name,
p.name, p.sysobjectid, pt.name,
+$query_str = "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,
d.snmp_authkey, d.snmp_authprotocol,
d.snmp_privkey, d.snmp_privprotocol,
d.snmp_securityname, e.name, m.name
@@ -105,8 +107,15 @@ $q = $netdot_db->Execute("
AND a.product_id=p.id
AND d.asset_id=a.id
AND p.type=pt.id
- ORDER BY rr.name;
-");
+";
+
+if ( isset($id) ){
+ $query_str .= ' AND d.id = ' . $id;
+}
+
+$query_str .= ' ORDER BY rr.name';
+
+$q = $netdot_db->Execute($query_str);
if (!$q) {
print "DB Error: ".$netdot_db->ErrorMsg();
@@ -619,6 +628,7 @@ function display_help() {
echo "usage: netdot_to_cacti.php [--no-graphs] [-d|--debug] [-h|-help]\n";
echo "\n";
echo "Optional:\n";
+ echo " --id Only include device with this netdot ID\n";
echo " --no-graphs Do not add graphs, only update devices and tree\n";
echo " -d|--debug Enable debugging output\n";
echo " -h|--help Display help and exit\n";
-----------------------------------------------------------------------
Summary of changes:
export/cacti/netdot_to_cacti.php | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
hooks/post-receive
--
Netdot
------------------------------
Message: 2
Date: Fri, 15 Nov 2013 12:47:07 -0800
From: [email protected]
Subject: [Netdot-devel] [SCM] Netdot branch netdot-1.0 updated.
netdot-1.0.4-128-g5083baa
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 5083baa6141fa04b937ee2f07a98fffc2747f76e (commit)
from 57ebef08e9e60b02ac66ee8699c88f84d8f56f43 (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 5083baa6141fa04b937ee2f07a98fffc2747f76e
Author: Carlos Vicente <[email protected]>
Date: Fri Nov 8 06:56:24 2013 -0500
Correction
diff --git a/export/cacti/netdot_to_cacti.php b/export/cacti/netdot_to_cacti.php
index 855d098..5a7ffbd 100644
--- a/export/cacti/netdot_to_cacti.php
+++ b/export/cacti/netdot_to_cacti.php
@@ -432,16 +432,17 @@ foreach ($groups as $group => $hosts){
/*
-----------------------------------------------------------------------------------------------------
*/
/* Clean up stale groups and nodes in the tree */
-foreach($hostNodes as $oldNode){
- debug("Deleting old tree node: $oldNode");
- db_execute("DELETE FROM graph_tree_items WHERE id=$oldNode");
-}
-foreach($headerNodes as $oldHeader){
- debug("Deleting old tree header: $oldHeader");
- db_execute("DELETE FROM graph_tree_items WHERE id=$oldHeader");
+if ( !isset($id) ){
+ foreach($hostNodes as $oldNode){
+ debug("Deleting old tree node: $oldNode");
+ db_execute("DELETE FROM graph_tree_items WHERE id=$oldNode");
+ }
+ foreach($headerNodes as $oldHeader){
+ debug("Deleting old tree header: $oldHeader");
+ db_execute("DELETE FROM graph_tree_items WHERE id=$oldHeader");
+ }
}
-
/*
-----------------------------------------------------------------------------------------------------
*/
// Subroutines
/*
-----------------------------------------------------------------------------------------------------
*/
-----------------------------------------------------------------------
Summary of changes:
export/cacti/netdot_to_cacti.php | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 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 80, Issue 11
********************************************