findmypast/icingaweb2-module-graphite

Error after icingaweb2 update (official release)

Closed this issue · 4 comments

My graphite modul dosent work after the update from the git version of IcingawWeb2 to the offical release of IcingaWeb2.
It works alone in it's environment but not in icingaweb2.

The images at icingaweb2 are broken and if I click on them I always get the same error:

Graphite encountered an unexpected error while handling your request.Please contact your site administrator if the problem persists.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/dist-packages/graphite/render/views.py", line 199, in renderView image = doImageRender(requestOptions['graphClass'], graphOptions)
File "/usr/lib/python2.7/dist-packages/graphite/render/views.py", line 407, in doImageRender img = graphClass(**graphOptions)
File "/usr/lib/python2.7/dist-packages/graphite/render/glyph.py", line 189, in __init__ self.drawGraph(**params)
File "/usr/lib/python2.7/dist-packages/graphite/render/glyph.py", line 630, in drawGraph self.setColor( self.foregroundColor )
File "/usr/lib/python2.7/dist-packages/graphite/render/glyph.py", line 209, in setColor r,g,b = ( int(s[0:2],base=16), int(s[2:4],base=16), int(s[4:6],base=16) ) ValueError: invalid literal for int() with base 16: 'bl'

These are my apache logs:

graphite-web_access.log

[26/Oct/2015:11:26:56 +0100] "GET /icingaweb2/layout/menu HTTP/1.1" 200 1505 "http://vs-icinga/icingaweb2/monitoring/host/show?host=testserver" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.71 Safari/537.36"

graphite-web_error.log

[Mon Oct 26 11:26:47.730525 2015] [wsgi:error] [pid 32090] /usr/lib/python2.7/dist-packages/graphite/settings.py:234: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security
[Mon Oct 26 11:26:47.730584 2015] [wsgi:error] [pid 32090] warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')

error.log

[Mon Oct 26 06:48:38.688178 2015] [wsgi:warn] [pid 2546] mod_wsgi: Compiled for Python/2.7.8.
[Mon Oct 26 06:48:38.688206 2015] [wsgi:warn] [pid 2546] mod_wsgi: Runtime using Python/2.7.9.
[Mon Oct 26 06:48:38.691420 2015] [mpm_prefork:notice] [pid 2546] AH00163: Apache/2.4.10 (Ubuntu) mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations
[Mon Oct 26 06:48:38.691454 2015] [core:notice] [pid 2546] AH00094: Command line: '/usr/sbin/apache2'

It looks like an issue with your graphite installation. The plugin does not do anything special, it just embeds the graphite image in an iframe, you could try and get the source from the iframe and try that in a browser, it may help guide you to the source of the behavior that you are seeing.

Did you find any resolution to this?
Seems that since the Graphite graph structure has fundamentally changed with last update of Icinga2, the icingaweb2/graphite integration module doesn't work any more (the graph URL's are completely different)

For example - a ping4 / rta graph usually had the URL:
?graphite_url=http///render/?target/.Ping4.rta.value/source

But now it's:
?graphite_url=http///render/?target/.services.ping4.ping4.perfdata.rta.value

(or something like that...)

Cheers,
Kalle Larsson

You can use macro templates in the configuration which may help here with that: https://github.com/findmypast/icingaweb2-module-graphite/blob/master/application/views/scripts/config/index.phtml#L20

Also there is a legacy_mode flag which can be set to true to support the old style targets.

Thanks a lot!
Works like a charm.

Have a nice day!

Cheers,
Kalle

-----Original Message-----
From: "Philip Hoy" notifications@github.com
Sent: Thursday, 19 November, 2015 11:04
To: "findmypast/icingaweb2-module-graphite" icingaweb2-module-graphite@noreply.github.com
Cc: "kalle1024" kalle@hemmabruket.net
Subject: Re: [icingaweb2-module-graphite] Error after icingaweb2 update (official release) (#27)

You can use macro templates in the configuration which may help here with that: https://github.com/findmypast/icingaweb2-module-graphite/blob/master/application/views/scripts/config/index.phtml#L20
Also there is a legacy_mode flag which can be set to true to support the old style targets.

Reply to this email directly or view it on GitHub .