ITxPT / lsinv

bash command line tool for listing inventories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lsinv

The lsinv.sh bash-script allows on linux machines running an avahi-daemon and having avahi-utils installed to list all available ITxPT inventory services. The default output is generated as a JSON array.

Prerequisits

  • The following tools need to be installed:

    • avahi-daemon

    • avahi-utils (for avahi-browse)

    • grepcidr

    • jq

  • avahi-daemon disable for IPv6

If you don’t already have a folder for github repos, Create one.. Ex:

sudo mkdir /opt/git

Then move into that folder

cd /opt/git

Then from there clone the lsinv repo

sudo git clone https://github.com/ITxPT/lsinv.git

This will create a subfolder named lsinv, move into that folder..

cd lsinv

_Note:_To make the script available as bash command use a symbolic link. Within the repository folder execute the following command:

sudo ln -s $(pwd)/lsinv.sh /usr/local/bin/lsinv

Usage

Download repository and use tool directly from installation folder or copy /usr/local/bin:

./lsinv.sh  -i 192.168.1.0/24

Known issues

  • Due to optional fields and the fact that JSON allows unsorted fields the CSV output is unreliable

About

bash command line tool for listing inventories


Languages

Language:Shell 82.7%Language:Awk 17.3%