Send netdisco-users mailing list submissions to
        netdisco-users@lists.sourceforge.net

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
        netdisco-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
        netdisco-users-ow...@lists.sourceforge.net

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 (Brian Marshall)
--- Begin Message --- Hi list, I know this is a _very_ old thread, but it just kind of ended up with a link to the Wiki which, while an excellent source of a lot of things to do with custom reports, still doesn't have an example .pm for column munging.

I'd love to be able to do a few things like make some columns into hotlinks (eg. CVE numbers going to NIST definitions), but I'm not sure where to get started with the "munging".

On 6/24/21 02:14, Ruben Moretti via netdisco-users wrote:

Hi Oliver !

Thanks a lot !

Maybe a Perl script as an example to mung the data that is called up in this way?I can't see how to access the input for the script, and I don't know what the output should look like either.I only know that the Perl script should have the same name as the report tag and must be located under site_plugins.

Thanks in advance,



Am 23.06.2021 um 22:59 schrieb Oliver Gorwits:
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 <mich...@butash.net> 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
    <miha.kr...@gmail.com> 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 <http://device.name/> AS host,
        device_port.ip, device_port.port, device_port.name
        <http://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 <alcat...@gmail.com> wrote:

            Does anyone else have any other handy custom reports they
            can share?

            *From: *Miha Kralj <miha.kr...@gmail.com>
            *Date: *Wednesday, 23 June 2021 at 15:20
            *To: *Ruben Moretti <news.liste...@googlemail.com>
            *Cc: *<netdisco-users@lists.sourceforge.net>
            *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 <netdisco-users@lists.sourceforge.net> 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
                netdisco-users@lists.sourceforge.net
                https://sourceforge.net/p/netdisco/mailman/netdisco-users/

        _______________________________________________
        Netdisco mailing list
        netdisco-users@lists.sourceforge.net
        https://sourceforge.net/p/netdisco/mailman/netdisco-users/

    _______________________________________________
    Netdisco mailing list
    netdisco-users@lists.sourceforge.net
    https://sourceforge.net/p/netdisco/mailman/netdisco-users/



_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net
https://sourceforge.net/p/netdisco/mailman/netdisco-users/


_______________________________________________
Netdisco mailing list
netdisco-users@lists.sourceforge.net
https://sourceforge.net/p/netdisco/mailman/netdisco-users/

--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
netdisco-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to