Skip to content

Commit

Permalink
report out IP in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dbsqp authored Apr 9, 2021
1 parent 4d8f573 commit be413a7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions nut-influxdbv2-exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from nut2 import PyNUTClient
from influxdb_client import InfluxDBClient, Point, WriteOptions
from influxdb_client.client.write_api import SYNCHRONOUS
import json
import json, socket


# NUT related variables
Expand Down Expand Up @@ -37,7 +37,7 @@
nut_debug="true"
else:
debug = False
nut_debug="false"
nut_debug=""


# report debug status
Expand All @@ -47,6 +47,14 @@
print ( " debug: FALSE" )


# get IP address
hostname = socket.gethostname()
host_ip = socket.gethostbyname(hostname)
if debug:
print ( " hostname: "+hostname )
print ( " IP: "+host_ip )


# setup InfluxDB
influxdb2_url="http://" + influxdb2_host + ":" + str(influxdb2_port)
if debug:
Expand Down

0 comments on commit be413a7

Please sign in to comment.