influx_nut


Recommended Posts

I'd bet it should work, although I think Unraid is missing the python interpreter, because I saw it in "Nerd Tools" plugin.  If you don't have the Nerd Tools plugin already, I would download that plugin and from there install Python - afterwards try your script again.

Link to comment
On 10/3/2018 at 4:04 PM, Jcloud said:

I'd bet it should work, although I think Unraid is missing the python interpreter, because I saw it in "Nerd Tools" plugin.  If you don't have the Nerd Tools plugin already, I would download that plugin and from there install Python - afterwards try your script again.

Yep. Forgot to mention I have Nerd Tools and have Python3 and Python installed.

 

Tried running it but ran into a number of command errors. Looks like its not able to run even though python is installed... 

 

Script location: /tmp/user.scripts/tmpScripts/influx_nut/script
Note that closing this window will abort the execution of this script
/tmp/user.scripts/tmpScripts/influx_nut/script: line 2: import: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 3: import: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 4: import: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 5: import: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 6: import: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 7: import: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 8: from: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 10: import: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 13: __doc__: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 15: DEFAULT_CONFIG: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 17: interval:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 19: nut_host:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 21: nut_port:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 23: nut_ups:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 33: nut_vars:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 36: influx_host:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 39: influx_db:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 42: influx_tags:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 47: influx_creds:: command not found
/tmp/user.scripts/tmpScripts/influx_nut/script: line 48: syntax error near unexpected token `}'
/tmp/user.scripts/tmpScripts/influx_nut/script: line 48: `}'

 

None of the co

Link to comment

You may need to install those python modules that are listed in the import statements.  Some may be included in the default python install but some may not.

 

import socket

import collections

import time

import json

import os

import sys

from typing import Tuple, Mapping, Iterable

import requests

 

You can also try adding your path to python in the top line.

 

Default for most installs is #!/usr/bin/python.  I'm not sure what it is for unraid.

 

Also try running your script as "python /tmp/user.scripts/tmpScripts/influx_nut/script" instead of just calling the script directly.

Edited by RAINMAN
  • Upvote 1
Link to comment
2 hours ago, RAINMAN said:

You may need to install those python modules that are listed in the import statements.  Some may be included in the default python install but some may not.

 

import socket

import collections

import time

import json

import os

import sys

from typing import Tuple, Mapping, Iterable

import requests

 

You can also try adding your path to python in the top line.

 

Default for most installs is #!/usr/bin/python.  I'm not sure what it is for unraid.

 

Also try running your script as "python /tmp/user.scripts/tmpScripts/influx_nut/script" instead of just calling the script directly.

Thanks

 

I added the path to python in the top line and it ran. However, there is a syntax error on line 64.

 

def __init__(self, measurement, fields, tags: dict = {},
^
SyntaxError: invalid syntax

I'm looking into this now in case anyone else is interested.

@RAINMAN - if you happen to know how to fix this please let me know

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.