Agent to install on the docker server to manage containers though netbox plugin.
go to the nodered admin page to change the settings.
docker stop netbox-data-agent
docker rm netbox-data-agent
docker image rm saashup/netbox-data-agent
docker volume rm netbox-data-agent
docker build -t saashup/netbox-data-agent .
docker run -d -p 1880:1880 -v /var/run/docker.sock:/var/run/docker.sock:rw -v netbox-data-agent:/data --name netbox-data-agent -e NETBOX_TOKEN=TOKEN -e NETBOX_URL=URL saashup/netbox-data-agent
container must have rw access to the docker unix socket (/var/run/docker.sock)
Default access is admin/saashup
On the root of the project run:
npm install
DATAPATH=. npx node-red -u . -s settings_dev.js
Then you can browse http://localhost:1880/nodered. Default access is admin/saashup.
log into ui page to see your docker assets
The application has a '/metrics' endpoint which can be used with prometheus to monitor if the access on the docker daemon socket is working and if all the containers are up and running.
The following metrics are currently exposed:
Example of prometheus configuration:
- job_name: 'netbox-data-agent'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['IP_ADDRESS:1880']
metrics_path: "/metrics"
basic_auth:
username: 'admin'
password: 'saashup'
Currently all logs are send to stdout, if netbox send an error message to the agent.
The format of the error message is the following one:
${data.name} level=${level[lvl]} version=${data.version} msg=${JSON.stringify(msg.msg)}
This can be changed by updating inside the INIT flow the "settings.js template" and change the logging.console.handler .
Check https://saashup.com for more information