Send netdisco-users mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/netdisco-users
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 netdisco-users digest..."
Today's Topics:

   1. Re: Issue with Network Map (Oliver Gorwits)
   2. Re: need help troubleshooting a new netdisco2 install
      (Oliver Gorwits)
   3. Re: Netdisco 2 Plugin System (Oliver Gorwits)
   4. Re: Netdisco 2 questions (Oliver Gorwits)
   5. Re: Netdisco 2 Plugin System (Daniel Tuecks)
   6. Patch proposal for limiting the netmap node depth in      netdisco
      2 (Daniel Tuecks)
--- Begin Message ---

Many thanks for the patch Daniel, I've attached it to the tracker ticket.

regards,
oliver.

On 2013-12-05 15:11, Daniel Tuecks wrote:
Hello,

I ran into a slight problem when using the 'domain_suffix' parameter:
Clicking a device in the network map results in a 'no such device'
error (That's the same error as documented in the bugtracker
http://sourceforge.net/p/netdisco/netdisco2/48/ [1]) . Attached to
this mail is a patch that should fix this issue.

regards
Daniel



Links:
------
[1] http://sourceforge.net/p/netdisco/netdisco2/48/




--- End Message ---
--- Begin Message ---
On 2013-12-02 12:45, Robert Kerr wrote:
On 30/11/13 17:58, Daniel Tuecks wrote:
... and if you'd like to add a password to that user, remember to store
your password as md5.

update users set password = md5('mypassword') where username = 'myusername';

If/when user management gets added to version 2 can I also suggest the method for storing passwords is re-considered. A single iteration of MD5
with no salting really isn't a great idea these days.
Authen::Passphrase or Dancer::Plugin::Passphrase look like they provide
various more secure options.

Certainly... but we need to do it in a way that doesn't make Netdisco 1 explode, or worse.

Thanks for the pointers to the AuthN modules... noted.

regards,
oliver.



--- End Message ---
--- Begin Message ---
Hi Daniel,

On 2013-12-03 19:33, Daniel Tuecks wrote:
- How will Netdisco 2 (or Dancer) every use a custom template path?

I follow your logic, but I think you need to look in the Dancer::Template::TemplateToolkit package to work out what's happening. Anyway, I do think the register path code works fine.

As a test (and this was something I wanted to do anyway), I extracted the Observium plugin into its own Distribution on CPAN. That way you have a full working example to poke at:

https://metacpan.org/pod/App::NetdiscoX::Web::Plugin::Observium

I hope this helps.

- Does Netdisco or Dancer provide any way to 'auto-login' with a
pre-shared key?

No, but having login via a web API call is a good idea. I'll add a tracker item to allow this. Rather than using a pre shared token, I think the way many web services do it is to perform a login and then get returned a token which is passed in a header with each call to the API (i.e. instead of a cookie). Would this be OK?

Another thing that came to my mind are custom-roles. Right now
netdisco only has a few pre-defined roles. Maybe it would be helpful
if a plugin could use its own roles. For example my webservice user
could get a 'webservice' role, so the webservice would not be
available to all the GUI admins/users. But I fear this would most
likely require a db-schema extension, so this will not be possible any
time soon, right?

In fact it's not a problem _adding_ columns to the users table for other roles. What kinds of actions would the webservice role have that, say, the port_control role does not, at present?

regards,
oliver.




--- End Message ---
--- Begin Message ---
On 2013-12-08 18:12, Oliver Gorwits wrote:
~/bin/netdisco-do -d <device-ip>

sorry, should be:

~/bin/netdisco-do discover -d <device-ip>




--- End Message ---
--- Begin Message ---
Hi Oliver,

thanks for your reply.

2013/12/8 Oliver Gorwits <[email protected]>

> Hi Daniel,
>
> On 2013-12-03 19:33, Daniel Tuecks wrote:
> > - How will Netdisco 2 (or Dancer) every use a custom template path?
>
> I follow your logic, but I think you need to look in the
> Dancer::Template::TemplateToolkit package to work out what's happening.
> Anyway, I do think the register path code works fine.
>
> As a test (and this was something I wanted to do anyway), I extracted
> the Observium plugin into its own Distribution on CPAN. That way you
> have a full working example to poke at:
>
> https://metacpan.org/pod/App::NetdiscoX::Web::Plugin::Observium
>
> I hope this helps.
>
>
Ok, thank you very much. I'll have a look at the package and the plugin
again
and hope this sheds some light :) But as the case may be I'll have to get
back
to that topic later :)

 > - Does Netdisco or Dancer provide any way to 'auto-login' with a
> > pre-shared key?
>
> No, but having login via a web API call is a good idea. I'll add a
> tracker item to allow this. Rather than using a pre shared token, I
> think the way many web services do it is to perform a login and then get
> returned a token which is passed in a header with each call to the API
> (i.e. instead of a cookie). Would this be OK?
>
>
I think so. Actually I'd just like to have a method, that allows an easy
to automate login mechanism :)


> > Another thing that came to my mind are custom-roles. Right now
> > netdisco only has a few pre-defined roles. Maybe it would be helpful
> > if a plugin could use its own roles. For example my webservice user
> > could get a 'webservice' role, so the webservice would not be
> > available to all the GUI admins/users. But I fear this would most
> > likely require a db-schema extension, so this will not be possible
> > any
> > time soon, right?
>
> In fact it's not a problem _adding_ columns to the users table for
> other roles. What kinds of actions would the webservice role have that,
> say, the port_control role does not, at present?
>
>
I was thinking about plugins in general. For example: One could write a
plugin
that includes detail data for each device, like device configs, etc in a
seperate device tab (yes, I did see the new RANCID plugin, but it would be
nice if a such plugin could be integrated even closer). That tab should
only be
visible if you are allowed to see those details. I might want to have
admins/staff
who can discover or port-control a device, but who are not allowed to see
device-configs.
This could be handled with an additional role somehow, I think.
For the mentioned REST plugin, it would be nice If I could say
"has_role REST-user", so that a 'normal' admin would not be able to use
his credentials to use the webservice. This way I could be sure that such
admin-accounts would not be 'misused' for automating something.
So that's just my idea why custom roles would probably be a nice-to-have
feature. :)


regards,
> oliver.
>
>
>
> ------------------------------------------------------------------------------
> Sponsored by Intel(R) XDK
> Develop, test and display web and hybrid apps with a single code base.
> Download it for free now!
>
> http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
> _______________________________________________
> Netdisco mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/netdisco-users
>

--- End Message ---
--- Begin Message ---
Hello developers,

I have this patch proposal for limiting the node depth on the netmap tab
(see http://sourceforge.net/p/netdisco/netdisco2/47/). The patch adds a
sidebar to the netmap. The sidebar provides a field to enter the maximum
node depth as a number. Max depth '1' will display all neighbour nodes, max
depth '2' will display neighbours of neighbours and so on. '0' or an empty
field will display all nodes (like the map does now).

regards.
Daniel
diff -crBN netdisco-netdisco-ng/Netdisco/MANIFEST netdisco-netdisco-ng-patches/Netdisco/MANIFEST
*** netdisco-netdisco-ng/Netdisco/MANIFEST	2013-12-09 17:05:25.712727275 +0100
--- netdisco-netdisco-ng-patches/Netdisco/MANIFEST	2013-12-09 17:07:38.500727224 +0100
***************
*** 300,305 ****
--- 300,306 ----
  share/views/report.tt
  share/views/search.tt
  share/views/sidebar/device/ports.tt
+ share/views/sidebar/device/netmap.tt
  share/views/sidebar/search/device.tt
  share/views/sidebar/search/node.tt
  share/views/sidebar/search/port.tt
diff -crBN netdisco-netdisco-ng/Netdisco/share/views/ajax/device/netmap.tt netdisco-netdisco-ng-patches/Netdisco/share/views/ajax/device/netmap.tt
*** netdisco-netdisco-ng/Netdisco/share/views/ajax/device/netmap.tt	2013-12-09 17:05:25.744727276 +0100
--- netdisco-netdisco-ng-patches/Netdisco/share/views/ajax/device/netmap.tt	2013-12-09 17:07:12.260726840 +0100
***************
*** 60,66 ****
  
  // handler for clicking on a circle - redirect to that device's netmap
  function circleClick(d) {
!     window.location = '[% uri_for('/device') %]?tab=netmap&q=' + (d.name || d.ip);
  }
  
  // handler for mouseover on a circle - show that device's real neighbors
--- 60,66 ----
  
  // handler for clicking on a circle - redirect to that device's netmap
  function circleClick(d) {
!     window.location = '[% uri_for('/device') %]?tab=netmap&q=' + (d.name || d.ip) + '&d=[% params.d %]';
  }
  
  // handler for mouseover on a circle - show that device's real neighbors
***************
*** 92,109 ****
    neighbors_data = data;
  
    // draw the tree
!   d3.json("[% uri_for('/ajax/data/device/netmap') %]?&q=[% params.q | uri %]", function(error, root) {
      var nodes = tree.nodes(root),
          links = tree.links(nodes);
  
      var link = svg.selectAll(".link")
!         .data(links)
        .enter().append("path")
          .attr("class", "link")
          .attr("d", treeLink);
  
      var node = svg.selectAll(".node")
!         .data(nodes)
        .enter().append("g")
          .attr("class", "node")
          .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; });
--- 92,111 ----
    neighbors_data = data;
  
    // draw the tree
!   d3.json("[% uri_for('/ajax/data/device/netmap') %]?&q=[% params.q | uri %]&d=[% params.d %]", function(error, root) {
      var nodes = tree.nodes(root),
          links = tree.links(nodes);
  
+     var max_depth = [% params.d || 0 %];
+ 
      var link = svg.selectAll(".link")
!         .data(links.filter(function(d) { if (max_depth != 0) { return d.target.depth <= max_depth; } else { return d; }})) 
        .enter().append("path")
          .attr("class", "link")
          .attr("d", treeLink);
  
      var node = svg.selectAll(".node")
!         .data(nodes.filter(function(d) { if (max_depth != 0) { return d.depth <= max_depth; } else { return d; }}))
        .enter().append("g")
          .attr("class", "node")
          .attr("transform", function(d) { return "rotate(" + (d.x - 90) + ")translate(" + d.y + ")"; });
diff -crBN netdisco-netdisco-ng/Netdisco/share/views/js/common.js netdisco-netdisco-ng-patches/Netdisco/share/views/js/common.js
*** netdisco-netdisco-ng/Netdisco/share/views/js/common.js	2013-12-09 17:05:25.748727276 +0100
--- netdisco-netdisco-ng-patches/Netdisco/share/views/js/common.js	2013-12-09 17:56:11.432697106 +0100
***************
*** 96,101 ****
--- 96,106 ----
          $('#ports_form')
            .find('input[name="q"],input[name="f"],input[name="partial"],input[name="invert"]')
            .serialize())
+       [% ELSIF tab.tag == 'netmap' %]
+       // form reset icon on netmap tab
+       $('#nd_sidebar-reset-link').attr('href', uri_base + '/device?tab=[% tab.tag %]&reset=on&' + 
+         $('#netmap_form') 
+           .find('input[name="q"]').serialize())
        [% END %]
  
        do_search(event, '[% tab.tag %]');
diff -crBN netdisco-netdisco-ng/Netdisco/share/views/sidebar/device/netmap.tt netdisco-netdisco-ng-patches/Netdisco/share/views/sidebar/device/netmap.tt
*** netdisco-netdisco-ng/Netdisco/share/views/sidebar/device/netmap.tt	1970-01-01 01:00:00.000000000 +0100
--- netdisco-netdisco-ng-patches/Netdisco/share/views/sidebar/device/netmap.tt	2013-12-09 17:07:12.264726775 +0100
***************
*** 0 ****
--- 1,9 ----
+ 
+             <input name="q" value="[% params.q | html_entity %]" type="hidden"/>
+               <label class="nd_collapser">Maximum depth</label>
+               <input id="nd_port-query" placeholder="Enter max link depth"
+                 name="d" value="[% params.d | html_entity %]" type="text"
+                 rel="tooltip" data-placement="left" data-offset="5" data-title="Max depth"/>
+           <button id="[% tab.id %]_submit" type="submit" class="btn btn-info">
+               <i class="icon-search icon-large pull-left nd_navbar-icon"></i> Update View</button>
+ 

--- End Message ---
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Netdisco mailing list - Digest Mode
[email protected]
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to