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 (Michael Butash)
2. Re: perl script for custom reports (Oliver Gorwits)
--- Begin Message ---
Probably nice to make a /contrib directory for these folks could drop into
a repo for other user-created reports they find useful.
Reading this thread, I was wondering about looking at making a custom
report to fix nbt node views. It's really quite annoying it doesn't give
the ip address in the main view, would be nice to add a like report with
just that if not adding to the existing one.
-mb
On Tue, Jun 22, 2021 at 11:23 PM Miha Kralj <[email protected]> wrote:
> 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/
>>
>> _______________________________________________
> Netdisco mailing list
> [email protected]
> https://sourceforge.net/p/netdisco/mailman/netdisco-users/
--- End Message ---
--- Begin Message ---
A wiki page might do as well - can be collaboratively edited with suggested
reports and grouped by topic similar to the menus
....time passes...
I created one :) https://github.com/netdisco/netdisco/wiki/Custom-Reports
On Wed, 23 Jun 2021 at 21:36, Michael Butash <[email protected]> wrote:
> Probably nice to make a /contrib directory for these folks could drop into
> a repo for other user-created reports they find useful.
>
> Reading this thread, I was wondering about looking at making a custom
> report to fix nbt node views. It's really quite annoying it doesn't give
> the ip address in the main view, would be nice to add a like report with
> just that if not adding to the existing one.
>
> -mb
>
>
> On Tue, Jun 22, 2021 at 11:23 PM Miha Kralj <[email protected]> wrote:
>
>> 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/
>>>
>>> _______________________________________________
>> Netdisco mailing list
>> [email protected]
>> https://sourceforge.net/p/netdisco/mailman/netdisco-users/
>
> _______________________________________________
> 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