SaaShup / netbox-docker-plugin

Netbox Docker Plugin
https://saashup.com
BSD 3-Clause "New" or "Revised" License
65 stars 5 forks source link

:art: adding an error state on host #165

Open lvenier opened 1 week ago

lvenier commented 1 week ago
Netbox version Plugin Version Agent version Docker API Version
4.* 2.* 0.39.* *

Actual Behavior

When we add a Host the agent is sending back a "Running" State change to the host as soon as it has been contacted. If the agent is not funtionnal as per issue https://github.com/SaaShup/netbox-docker-agent/issues/142 this information is not sent back to the host

Desired Behavior

If the agent has no access to the docker unix socket I would return a "Error" state to the host to inform there is a problem.

CHOICES = [ (STATE_CREATED, "Created", "dark"), (STATE_RUNNING, "Running", "blue"), (STATE_ERROR, "Error", "red"), (STATE_DELETED, "Deleted", "blue"), (STATE_REFRESHING, "Refreshing", "blue"), ]

As a nice to have a journal entry could be added with a message to inform of the issue.