[Support] for atribe's repo Docker images


Recommended Posts

Connecting to InfluxDB host:xyz, DB:nut
Connected successfully to InfluxDB
Connecting to NUT host xyz:3493
Connected successfully to NUT
Error connecting to InfluxDB.

The same with DEBUG on:

[DEBUG] http://localhost:8086 "POST /write?db=nut HTTP/1.1" 400 158
Traceback (most recent call last):
File "/src/nut-influxdb-exporter.py", line 113, in <module>
print(client.write_points(json_body))
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 594, in write_points
return self._write_points(points=points,
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 672, in _write_points
self.write(
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 404, in write
self.request(
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 369, in request
raise InfluxDBClientError(err_msg, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"partial write: field type conflict: input field \"ups.temperature\" on measurement \"ups_status\" is type integer, already exists as type float dropped=1"}

Error connecting to InfluxDB.

 

The nut-influxdb-exporter container log is full of these.

The problem is that there are long time periods during which no values are written by the exporter into influxbd.

The curious thing is, that in the influxdb log I see frequent periodic POSTs of the exporter!

[httpd] 172.17.0.1 - nut-unraid [02/Aug/2020:15:23:29 +0200] "POST /write?db=nut HTTP/1.1" 400 156 "-" "python-requests/2.23.0" 5b11b2e5-d4c3-11ea-acab-0242ac110003 9191
ts=2020-08-02T13:23:40.173464Z lvl=info msg="Executing query" log_id=0ONPV9xl000 service=query query="CREATE DATABASE nut"
[httpd] 172.17.0.1 - nut-unraid [02/Aug/2020:15:23:40 +0200] "POST /query?db=nut&q=CREATE+DATABASE+%22nut%22 HTTP/1.1" 200 58 "-" "python-requests/2.23.0" 6124c50e-d4c3-11ea-acaf-0242ac110003 408
[httpd] 172.17.0.1 - nut-unraid [02/Aug/2020:15:23:40 +0200] "POST /write?db=nut HTTP/1.1" 400 156 "-" "python-requests/2.23.0" 612bbc82-d4c3-11ea-acb0-0242ac110003 7150
[httpd] 172.17.0.1 - nut-unraid [02/Aug/2020:15:23:50 +0200] "POST /query?db=nut&q=CREATE+DATABASE+%22nut%22 HTTP/1.1" 200 58 "-" "python-requests/2.23.0" 67398c3a-d4c3-11ea-acb5-0242ac110003 364
[httpd] 172.17.0.1 - nut-unraid [02/Aug/2020:15:23:50 +0200] "POST /write?db=nut HTTP/1.1" 400 156 "-" "python-requests/2.23.0" 67408967-d4c3-11ea-acb6-0242ac110003 8965
[httpd] 172.17.0.1 - nut-unraid [02/Aug/2020:15:24:10 +0200] "POST /query?db=nut&q=CREATE+DATABASE+%22nut%22 HTTP/1.1" 200 58 "-" "python-requests/2.23.0" 736c2a5c-d4c3-11ea-acc3-0242ac110003 352
[httpd] 172.17.0.1 - nut-unraid [02/Aug/2020:15:24:10 +0200] "POST /write

and so on...

For the fix see the next two postings.

 

 

Edited by b0m541
Link to comment

Is it normal that no data points are exported whole the UPS is running on battery?

It does only export data point while the UPS is on line input.

 

This is what the debug log gives:

 

[DEBUG] http://localhost:8086 "POST /write?db=nut HTTP/1.1" 400 156
Traceback (most recent call last):
File "/src/nut-influxdb-exporter.py", line 113, in <module>
print(client.write_points(json_body))
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 594, in write_points
return self._write_points(points=points,
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 672, in _write_points
self.write(
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 404, in write
self.request(
File "/usr/local/lib/python3.8/site-packages/influxdb/client.py", line 369, in request
raise InfluxDBClientError(err_msg, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"partial write: field type conflict: input field \"input.voltage\" on measurement \"ups_status\" is type integer, already exists as type float dropped=1"}

Error connecting to InfluxDB.

 

Looks to me like the exporter wants to write as integer if NUT provides no decimal point for a measurement that at other times contains a decimal point (this is the case for voltage, and when running on battery NUT measures as voltage 0 instead of 0.0).

 

I would suggest to cast all numerical measurements that main contain a decimal point always to float and not letting the interpreter decide the variable type automatically.

 

As a fix i just removed to conversion to integer -> no more errors in the log:

def convert_to_type(s):
    """ A function to convert a str to either integer or float. If neither, it will return the str. """
    try:
        float_var = float(s)
        return float_var
    except ValueError:
        return s

 

 

Edited by b0m541
Link to comment
  • 4 weeks later...

Tried to install Telegraf, and upon clicking Install I get this error:

Quote

root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='telegraf' --net='host' --privileged=true -e TZ="America/New_York" -e HOST_OS="Unraid" -e 'HOST_PROC'='/rootfs/proc' -e 'HOST_SYS'='/rootfs/sys' -e 'HOST_ETC'='/rootfs/etc' -e 'HOST_MOUNT_PREFIX'='/rootfs' -v '/var/run/utmp':'/var/run/utmp':'ro' -v '/var/run/docker.sock':'/var/run/docker.sock':'ro' -v '/':'/rootfs':'ro' -v '/sys':'/rootfs/sys':'ro' -v '/etc':'/rootfs/etc':'ro' -v '/proc':'/rootfs/proc':'ro' -v '/mnt/user/appdata/telegraf/telegraf.conf':'/etc/telegraf/telegraf.conf':'rw' 'telegraf:alpine' 

36df0b099550c9e14a2d021d9189b363c1e04ad0e04800640fdb837f6e126c83
/usr/bin/docker: Error response from daemon: OCI runtime create failed: container_linux.go:346: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"/mnt/user/appdata/telegraf/telegraf.conf\" to rootfs \"/var/lib/docker/btrfs/subvolumes/3a11b619ee233dddd59c8b03fcbf662ecf591c5e51d80a820b819d78a7dbcae1\" at \"/var/lib/docker/btrfs/subvolumes/3a11b619ee233dddd59c8b03fcbf662ecf591c5e51d80a820b819d78a7dbcae1/etc/telegraf/telegraf.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

The command failed.

I tried to go in after and manually uploaded the telgraf.conf to the proper location (confirmed it does not have .txt or anything at the end of it).

 

After trying to restart telegraf, it just tells me "Execution Error: Bad parameter".

 

Not sure how to resolve this issue.

Link to comment

Thanks @Nostrada that appears to have worked...

 

I have Grafana installed and everything appears to be running, however I'm unable to log in. I'm presented with the login page for Grafana, and I've entered the username (admin), and the password that I configured in the Grafana settings where the env variable was "GF_SECURITY_ADMIN_PASSWORD".

 

Unfortunately everytime I enter admin/password (the one I chose there), I'm greeted with "Invalid username or password".


I was trying to browse through the forums here to see if anyone else encountered it. I saw some reference to a grafana.ini, so I wanted to check that out. I actually can't find a grafana.ini file. It appears it's supposed to be under /etc/grafana/grafana.ini, however I can't even find anything  at /etc/grafana. In fact the only thing I've managed to find is /mnt/user/appdata/grafana which contains the grafana.db image, and an empty png and plugins folder.

 

Looking at the unraid log file, I can see the following:

 

Quote

t=2020-08-27T10:19:12-0400 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2020-08-27T10:19:12-0400 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from command line" logger=settings arg="default.log.mode=console"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_DATA=/var/lib/grafana"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_LOGS=/var/log/grafana"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_PLUGINS=/var/lib/grafana/plugins"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_PROVISIONING=/etc/grafana/provisioning"
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_SERVER_ROOT_URL=http://x.x.x.x
t=2020-08-27T10:19:12-0400 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_SECURITY_ADMIN_PASSWORD=*********"
t=2020-08-27T10:19:12-0400 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2020-08-27T10:19:12-0400 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2020-08-27T10:19:12-0400 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2020-08-27T10:19:12-0400 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
t=2020-08-27T10:19:12-0400 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2020-08-27T10:19:12-0400 lvl=info msg="App mode production" logger=settings
t=2020-08-27T10:19:12-0400 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3

It appears that it's configured correctly, however I still can't find any grafana folders at the referenced locations above... either at /usr/share/grafana, etc/grafana, or /var/lib/grafana.

Edited by NVS1
Link to comment

Having an issue trying to reset my grafana admin password I forgot so I cant view any of my dashboards. In the console I used grafana-cli admin reset-admin-password <password> and it said successful but it still doesnt work in the gui. Any ideas?

Edited by mkono87
Link to comment
  • 2 weeks later...

not really sure WTH i have done here, but i can not get telegraf to install the container. see screen shot below

Capture.thumb.JPG.31af40f1525e0ac4d320ce71a93cee16.JPG

 

I am running untelegraf currently, but its not able to access a database... i have followed the guide:

https://technicalramblings.com/blog/how-to-setup-grafana-influxdb-and-telegraf-to-monitor-your-unraid-system/

howto_monitor_unraid_with_grafana_influxhttps://www.reddit.com/r/unRAID/comments/7c2l2w/howto_monitor_unraid_with_grafana_influxdb_and/

and have no success. Any help would be greatly appreciated. 

 

 

***solved***

manually added telegraf folder into appdata and moved over the telegraf.conf file and it installed. 

Edited by TStavley
Link to comment
4 hours ago, Struck said:

Is it possible to have HDTEMP collect the serial number instead of the device id? 

The device ids, are shuffled every time i have a hardware change, which annoys me a bit.

You can do it via serial number if you wanted to instead of device id.

Screen Shot 2020-09-18 at 9.20.35 AM.png

Edited by JaseNZ
Added screen shot
Link to comment
18 minutes ago, JaseNZ said:

Sorry did not realise your were using hdd temp, I use smartctl you get a lot more info.

These are my two lines in the telegraf.conf file.

 

[[inputs.smart]]

 attributes = true

I tried this. but telegraf 
smartctl not found:

when i try to put the path to smartctl in telegraf.conf it says 

Error in plugin: failed to run command '/usr/sbin/smartctl --scan': fork/exec /usr/sbin/smartctl: no such file or directory 

if i run /usr/sbin/smartctl --scan in the terminal it works without error, even just smartctl --scan 
so smartctl is in the PATH, but somehow telegraf can not find it.

 

Some permission thing?

Link to comment
4 minutes ago, JaseNZ said:

The only thing I can think of is where your repositry is.

Check its pulling from the the Repository telegraf:latest

 

I know when I was trying to sort nvidia-smi permissions out I found I was pulling from telegraf:alpine instead of latest.

I was indeed pulling from telegraf:alpine, but changing it to telegraf:latest does not solve my problem.

Link to comment
1 minute ago, Struck said:

Fixed it by using the path ito the smartctl from nside the docker container

path = "/rootfs/usr/sbin/smartctl"

 

Thank you

Nice glad you got it going, I am trying to sort out the [[inputs.diskio]] to report based on serial as well but no joy so far as all it reports is unknown.

Link to comment

Hello.
I'm having some issues with Influxdb.
I'm trying to sort out my databases and users.
My first issue (not directly related to Influxdb) is that when I try console right into the docker, after 5-10 seconds, it goes blank (I use Google Chrome).

I read that I could go into the flash drive directory and delete the content of config/ssh and config/ssl, which didn't help.
So I've turned to PuTTY.
I can use "docker exec -it Influxdb bash" and I'm in the docker.

But for some reason, I need to write 

influx -execute 'SHOW DATABASES'

to show the databases, and when I want to change a password on a user or something, it ain't easy.
I managed to check which version it is, and I'm running version 1.8.
I tried looking at the documentation, but it doesn't mention the

influx -execute

part, and that the command itself, needs to be with the apostrophe. The apostrophe part makes it hard when I need to create a user, and the normal command needs to be set up like this

CREATE USER paul WITH PASSWORD 'timeseries4days' WITH ALL PRIVILEGES

(copied directly from the documentation at https://docs.influxdata.com/influxdb/v1.8/administration/authentication_and_authorization/#re-set-a-user-s-password)
 

Am I missing something somewhere since I'm having a hard time making it work?

Edited by Nanobug
Link to comment
  • 2 weeks later...

Hello, I recently started using the NUT-InfluxDB-Exporter Docker container and it was working great up until yesterday. My Grafana dashboard stopped showing any data on the UPS. Upon looking in the logs for the container, it shows the below over and over. Also, it seems that the NUT plugin stopped working. I went  to the settings to look at the settings and It showed that it was running, but it was not showing me any data. I used the "Reload" button and this did not help. I then stopped the service by setting the first option to "No" and then set it back to "Yes" to start it again. Now, even when it is set to yes, the status shows "stopped". Screenshot below. 

 

Connecting to InfluxDB host:192.168.89.5, DB:nut
Connected successfully to InfluxDB
Connecting to NUT host 192.168.89.5:3493
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/nut2.py", line 97, in _connect
self._srv_handler = telnetlib.Telnet(self._host, self._port,
File "/usr/local/lib/python3.8/telnetlib.py", line 218, in __init__
self.open(host, port, timeout)
File "/usr/local/lib/python3.8/telnetlib.py", line 235, in open
self.sock = socket.create_connection((host, port), timeout)
File "/usr/local/lib/python3.8/socket.py", line 808, in create_connection
raise err
File "/usr/local/lib/python3.8/socket.py", line 796, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/src/nut-influxdb-exporter.py", line 47, in <module>
ups_client = PyNUTClient(host=nut_host, port=nut_port, login=nut_username, password=nut_password, debug=(verbose == 'true'))
File "/usr/local/lib/python3.8/site-packages/nut2.py", line 70, in __init__
self._connect()
File "/usr/local/lib/python3.8/site-packages/nut2.py", line 112, in _connect
raise PyNUTError("Socket error.")
nut2.PyNUTError: Socket error.

 

image.thumb.png.d89daf4764c2ca2dd0fc7cc514b5d524.png

 

Any ideas??

Edited by Richamc01
Added screenshot
Link to comment

Any chance anyone knows how I can prevent grafana from logging me out / requiring me to relogin so often?

I haven't timed it but I'm guessing its ~10 min

Looking at the settings page in the grafana webui I was taking a guess I might need to change the "token_rotation_interval_minutes" value?


image.png.c8414ac22d5415aad8d2711851781626.png


But I'm not sure what environment variable I'd need to set.

Tried 

GF_TOKEN_ROTATION_INTERVAL_MINUTES
TOKEN_ROTATION_INTERVAL_MINUTES
token_rotation_interval_minutes

and none of them seemed to change it.

Link to comment
1 hour ago, snowmirage said:

Any chance anyone knows how I can prevent grafana from logging me out / requiring me to relogin so often?

I haven't timed it but I'm guessing its ~10 min

Looking at the settings page in the grafana webui I was taking a guess I might need to change the "token_rotation_interval_minutes" value?


image.png.c8414ac22d5415aad8d2711851781626.png


But I'm not sure what environment variable I'd need to set.

Tried 

GF_TOKEN_ROTATION_INTERVAL_MINUTES
TOKEN_ROTATION_INTERVAL_MINUTES
token_rotation_interval_minutes

and none of them seemed to change it.


Try a different browser on the same computer, and then try the same browser on a different computer. That is not normal behavior, nor should you have to explicitly set something to stop this behavior. Out of the box, Grafana does not auto log you off. Credentials are stored in browser cookies. If cookies are cleared, you will have to log in again. Might be a browser specific setting...

Link to comment
2 hours ago, falconexe said:


Try a different browser on the same computer, and then try the same browser on a different computer. That is not normal behavior, nor should you have to explicitly set something to stop this behavior. Out of the box, Grafana does not auto log you off. Credentials are stored in browser cookies. If cookies are cleared, you will have to log in again. Might be a browser specific setting...

Cool thanks for the info, gives me a direction to troubleshoot in anyway!  Thanks

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.