linux-stats-dashboard icon indicating copy to clipboard operation
linux-stats-dashboard copied to clipboard

Fix for UnboundLocalError: local variable 'io_ms2' referenced before assignment

Open aweijnitz opened this issue 10 years ago • 3 comments

Hi, I tried to install your linux dashboard on my Raspberry Pi and ran into a minor issue (see below). Fixed it this morning and thought you might be interested in merging it back to your master.

Kind regards

Anders

HOW TO TRIGGER

Execute the script (following configuration according to the setup instructions)

$ ./stats2rrd.py
Traceback (most recent call last):
  File "./stats2rrd.py", line 218, in <module>
    main()
  File "./stats2rrd.py", line 41, in main
    disk_pct = disk_busy(DISK, 5)
  File "./stats2rrd.py", line 117, in disk_busy
    delta = int(io_ms2) - int(io_ms1)
UnboundLocalError: local variable 'io_ms2' referenced before assignment

ENVIRONMENT

Device: Raspberry Pi model B, 512MB RAM
OS: Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l
Python: v2.7.3

aweijnitz avatar Sep 19 '13 08:09 aweijnitz

Hi,

I tried installing your software on opensuse 15 and gave the following errors, what can it be?

thank you !!

Traceback (most recent call last): File "stats2rrd.py", line 218, in main() File "stats2rrd.py", line 46, in main rrd_ops('cpu_percent', cpu_pct, 'GAUGE', 'FF0000', localhost_name, 1000, upper_limit=100) File "stats2rrd.py", line 64, in rrd_ops rrd.create(INTERVAL, ds_type) File "stats2rrd.py", line 157, in create p = subprocess.Popen(shlex.split(cmd_create), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False) File "/usr/lib64/python2.7/subprocess.py", line 390, in init errread, errwrite) File "/usr/lib64/python2.7/subprocess.py", line 1025, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

dnlcesilva avatar Dec 08 '18 23:12 dnlcesilva

@dnlcesilva , install rrdtool

also, for future issues... please create a new issue rather than hijacking an old Pull Request :)

cgoldberg avatar Dec 09 '18 02:12 cgoldberg

Hahahaha... I'll create, sorry !! rrdtoll installed!!

dnlcesilva avatar Dec 09 '18 03:12 dnlcesilva