Export inventory to external server

Introduction

When using Advannet, it is possible to export the current inventory to an external server. That is, to send the tags being read in JSON format to a server that accepts POST requests.

Requirements

In order to send the inventory, you need to follow these steps:

1. Download the script send-inventory.sh from the downloads section

2. Upload the script to the reader:

2.1 Use an SFTP program such as Filezilla and connect to the reader using its IP , user and password. To get the credentials, please visit the following page: SSH Credentials

2.2 Upload the script to the directory /home/keonn

3. Assign executing permissions to the script by running the following command:

sudo chmod +x send-inventory.sh

4. Install curl and libxml-xpath-perl:

sudo apt-get install curl

sudo apt-get install libxml-xpath-perl

5. Execute the script by running the following command:

./send-inventory.sh <destination-url>

Where <destination-url> is the URL of the external server

The reader must be RUNNING to send an inventory

Sending the inventory periodically

It is also possible to run the script periodically and send an inventory, for example, every 5 minutes.

To do so, you need to use the Linux crontab utility. You can find more information on the following URL: How to use Linux cron

Test the service

If your server is not configured yet, you can use an available tool on the Internet to test the functionality of this service. To so, you can visit the following site:

https://requestbin.fullcontact.com/

This site allows you to create an URL to send HTTP requests. This way, you can run the script with the URL you are given, for example:

./send-inventory.sh http://requestbin.fullcontact.com/z2bce4z2

After running the script, you just need to refresh the requestBin page and you will be given the details of the request, with your inventory.

Downloads

The files are available below: