Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default tasks fail to run #24

Open
ncouture opened this issue Jun 9, 2014 · 0 comments · May be fixed by #25
Open

default tasks fail to run #24

ncouture opened this issue Jun 9, 2014 · 0 comments · May be fixed by #25

Comments

@ncouture
Copy link

ncouture commented Jun 9, 2014

This was encountered while following the installation instructions (http://rsaikali.github.io/django-skwissh/#installation) against the master branch.

To reproduce, after the ``manage.py installtasks'' installation step type:

crontab -l | cut -d ' '  -f6-100 | while read line; do $line; done

In order to execute the tasks installed in crontab.

Result:

(skwissh)skwissh@portemanteau ~/monitoring $ /home/skwissh/.virtualenvs/skwissh/bin/python /home/skwissh/monitoring/manage.py runtask getMeasures --settings=monitoring.settings 
(skwissh)skwissh@portemanteau ~/monitoring $ /home/skwissh/.virtualenvs/skwissh/bin/python /home/skwissh/monitoring/manage.py runtask averageDay --settings=monitoring.settings 
Exception in thread SkwisshAverage.MeasureDay.CPU_(Wait_IO):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/skwissh/.virtualenvs/skwissh/local/lib/python2.7/site-packages/django_skwissh-0.0.8-py2.7.egg/skwissh/cron.py", line 147, in calculateAveragesForPeriod
    values = [float(measure.value.split(";")[i]) for measure in measures]
ValueError: invalid literal for float(): 0.0 wa

(skwissh)skwissh@portemanteau ~/monitoring $ /home/skwissh/.virtualenvs/skwissh/bin/python /home/skwissh/monitoring/manage.py runtask averageWeek --settings=monitoring.settings 
Exception in thread SkwisshAverage.MeasureWeek.CPU_(Wait_IO):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/skwissh/.virtualenvs/skwissh/local/lib/python2.7/site-packages/django_skwissh-0.0.8-py2.7.egg/skwissh/cron.py", line 147, in calculateAveragesForPeriod
    values = [float(measure.value.split(";")[i]) for measure in measures]
ValueError: invalid literal for float(): 0.0 wa

(skwissh)skwissh@portemanteau ~/monitoring $ /home/skwissh/.virtualenvs/skwissh/bin/python /home/skwissh/monitoring/manage.py runtask averageMonth --settings=monitoring.settings 
Exception in thread SkwisshAverage.MeasureMonth.CPU_(Wait_IO):
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/skwissh/.virtualenvs/skwissh/local/lib/python2.7/site-packages/django_skwissh-0.0.8-py2.7.egg/skwissh/cron.py", line 147, in calculateAveragesForPeriod
    values = [float(measure.value.split(";")[i]) for measure in measures]
ValueError: invalid literal for float(): 0.0 wa

At first glance it seems like the following two lines from cron.py are the culprits:

values = [float(measure.value.split(";")[i]) for measure in measures]
all_values.append(str(round(float(sum(values) / len(values)), 2)))
ncouture added a commit to ncouture/django-skwissh that referenced this issue Jun 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant