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: perl script for custom reports (Muris)
   2. Re: Adding Community String (Miha Kralj)
   3. Re: perl script for custom reports (Miha Kralj)
--- Begin Message ---
Does anyone else have any other handy custom reports they can share?

 

From: Miha Kralj <[email protected]>
Date: Wednesday, 23 June 2021 at 15:20
To: Ruben Moretti <[email protected]>
Cc: <[email protected]>
Subject: Re: [Netdisco] perl script for custom reports

 

Hi,

There is a simple way to make custom reports...

My way to create custom reports is to place yml code at the end in 
environments/deployment.yml file like this:

 

reports:

  - tag: List_of_devices

    label: 'List of devices'

    category: Device

    columns:

    - { name: Device}

    - { ip: ip}

    - { creation: First_seen}

    - { last_discover: Last_discover}

    query: |

      SELECT name, ip, creation::timestamp(0), last_discover::timestamp(0) from 
device

        ORDER BY name

 

After that you can find a report on the web interface "Reports -- > Device -- > 
List of devices".

I hope it helps.

 

On Sun, Jun 20, 2021 at 3:31 PM Ruben Moretti via netdisco-users 
<[email protected]> wrote:

Hello !

Can anyone post some simple perl script example  for them ?

Thanks a lot.

 

 

https://github.com/netdisco/netdisco/wiki/Configuration#reports

You can munge the data retrieved from the database by placing a Perl script 
with the same name as the reports key into the “site_plugins” directory of 
Netdisco’s home area. The script can access $config for its configuration and 
@data for the retrieved data. It should return a list of munged data

 

_______________________________________________
Netdisco mailing list
[email protected]
https://sourceforge.net/p/netdisco/mailman/netdisco-users/


--- End Message ---
--- Begin Message ---
Hi,
the syntax should be like:

device_auth:
  - tag: 'default_v2_readonly'
    community: 'public'
    community: 'blah1'
    community: 'blah2'

On Tue, Jun 22, 2021 at 9:41 PM Denny Sabu <[email protected]> wrote:

> Hello All,
>
>
>
> I’m trying to add a community string to the deployments.yml file,
>
>
>
> I’ve added a community tag
>
>
>
> community:
>
>  - public
>
> - private
>
> - ******
>
>
>
> This doesn’t seem to work, so I also added to the device_auth section:
>
>
>
> device_auth
>
> […]
>
> - tag: “private_str”
>
> community: ‘*****’
>
> read: true
>
> write: false
>
>
>
> However, netdisco doesn’t seem to be able to connect.
>
>
>
> I can snmpwalk the machine from the same server with the community string
> and it connects, but a ./netdisco-do discover -d [IP] ends with “Could not
> SNMP connect to [IP]”
>
>
>
> Thanks in advance.
> _______________________________________________
> Netdisco mailing list
> [email protected]
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/

--- End Message ---
--- Begin Message ---
Another nice report is for finding all ports that are: Port down, Admin Up,
for 2 months
This means that ports are not used for at least 2 months and for security
reasons should be shut down.
The time range is configurable inside the query.

reports:
  - tag: portsdownall
    label: 'Port down, Admin Up - 2 months'
    category: Port
    columns:
    - { host: Device_name}
    - { ip: ip}
    - { port: Port}
    - { name: Description}
    - { status: Status}
    - { status_admin: 'Status Admin'}
    - { last_change: 'Last change'}
    query: |
      SELECT device.name AS host, device_port.ip, device_port.port,
device_port.name, device_port.up AS status, device_port.up_admin AS
status_admin,
        to_char((device.last_discover - (device.uptime -
device_port.lastchange) / 100 * interval '1 second'), 'YYYY-MM-DD
HH24:MI:SS') as last_change from device_port
      LEFT JOIN device ON device_port.ip = device.ip
      WHERE device_port.up = 'down'
        AND device_port.up_admin = 'up'
        AND device_port.port NOT LIKE '%Vlan%'
        AND (device.last_discover - (device.uptime -
device_port.lastchange) /
        100 * interval '1 second') < (now() - interval '2 month')

On Wed, Jun 23, 2021 at 8:07 AM Muris <[email protected]> wrote:

> Does anyone else have any other handy custom reports they can share?
>
>
>
> *From: *Miha Kralj <[email protected]>
> *Date: *Wednesday, 23 June 2021 at 15:20
> *To: *Ruben Moretti <[email protected]>
> *Cc: *<[email protected]>
> *Subject: *Re: [Netdisco] perl script for custom reports
>
>
>
> Hi,
>
> There is a simple way to make custom reports...
>
> My way to create custom reports is to place yml code at the end in
> environments/deployment.yml file like this:
>
>
>
> reports:
>
>   - tag: List_of_devices
>
>     label: 'List of devices'
>
>     category: Device
>
>     columns:
>
>     - { name: Device}
>
>     - { ip: ip}
>
>     - { creation: First_seen}
>
>     - { last_discover: Last_discover}
>
>     query: |
>
>       SELECT name, ip, creation::timestamp(0), last_discover::timestamp(0)
> from device
>
>         ORDER BY name
>
>
>
> After that you can find a report on the web interface "Reports -- > Device
> -- > List of devices".
>
> I hope it helps.
>
>
>
> On Sun, Jun 20, 2021 at 3:31 PM Ruben Moretti via netdisco-users <
> [email protected]> wrote:
>
> Hello !
>
> Can anyone post some simple perl script example  for them ?
>
> Thanks a lot.
>
>
>
>
>
> https://github.com/netdisco/netdisco/wiki/Configuration#reports
>
> You can munge the data retrieved from the database by placing a Perl
> script with the same name as the reports key into the “site_plugins”
> directory of Netdisco’s home area. The script can access $config for its
> configuration and @data for the retrieved data. It should return a list
> of munged data
>
>
>
> _______________________________________________
> Netdisco mailing list
> [email protected]
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/
>
>

--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
[email protected]
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to