adriaaah / monit-dashboard

A web dashboard for rule all monit servers at a glance
GNU Affero General Public License v3.0
26 stars 8 forks source link

Error 500 #5

Closed dkr closed 7 years ago

dkr commented 7 years ago

Hi. monit-dashboard]$ ./bin/monit-dashboard.py http://0.0.0.0:8080/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/web/application.py", line 239, in process return self.handle() File "/usr/lib/python2.7/site-packages/web/application.py", line 230, in handle return self._delegate(fn, self.fvars, args) File "/usr/lib/python2.7/site-packages/web/application.py", line 420, in _delegate return handle_class(cls) File "/usr/lib/python2.7/site-packages/web/application.py", line 396, in handle_class return tocall(*args) File "./bin/monit-dashboard.py", line 72, in GET return render.index(output=getMonit(), now=datetime.datetime.now()) File "./bin/monit-dashboard.py", line 34, in getMonit cf = json.loads(f.read()) File "/usr/lib64/python2.7/json/init.py", line 338, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) ValueError: Expecting property name: line 4 column 3 (char 63)

adriaaah commented 7 years ago

Hi, sorry for the late reply. could you please provide some context? Eg: OS, Python version… and did you check syntax in servers.json?

dkr commented 7 years ago

Hi, no problem. $ cat /etc/centos-release CentOS Linux release 7.3.1611 (Core) $ uname -a Linux r2-builder 3.10.0-514.21.2.el7.x86_64 #1 SMP Tue Jun 20 12:24:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux $ python -V Python 2.7.5

Yes, I did it (Data changed) $ cat servers.json { "Server Builder": { "url": "http://127.0.0.1:2812", "user": "user", "passwd": "passwd" }, }

adriaaah commented 7 years ago

I think there is a trailing comma in your servers.json. Please try below settings and, if it works, feel free to close it:

{
  "Server Builder": {
    "url": "http://127.0.0.1:2812",
    "user": "user",
    "passwd": "passwd"
  }
}
dkr commented 7 years ago

This is the "tail" of trying to configure two servers. But the result is different, but negative

$ ./monit-dashboard.py http://0.0.0.0:8080/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/web/application.py", line 239, in process return self.handle() File "/usr/lib/python2.7/site-packages/web/application.py", line 230, in handle return self._delegate(fn, self.fvars, args) File "/usr/lib/python2.7/site-packages/web/application.py", line 420, in _delegate return handle_class(cls) File "/usr/lib/python2.7/site-packages/web/application.py", line 396, in handle_class return tocall(*args) File "./monit-dashboard.py", line 72, in GET return render.index(output=getMonit(), now=datetime.datetime.now()) File "/usr/lib/python2.7/site-packages/web/template.py", line 1017, in getattr t = self._template(name) File "/usr/lib/python2.7/site-packages/web/template.py", line 1014, in _template return self._load_template(name) File "/usr/lib/python2.7/site-packages/web/template.py", line 1001, in _load_template raise AttributeError, "No template named " + name AttributeError: No template named index

172.25.50.5:57228 - - [03/Aug/2017 19:47:11] "HTTP/1.1 GET /" - 500 Internal Server Error 172.25.50.5:57228 - - [03/Aug/2017 19:47:11] "HTTP/1.1 GET /favicon.ico" - 404 Not Found 172.25.50.5:57228 - - [03/Aug/2017 19:47:11] "HTTP/1.1 GET /favicon.ico" - 404 Not Found

dkr commented 7 years ago

A solution is found. An error occurs if no applications are configured in Monit. There is only control of resources.