Hello list,

For historic reporting purpose, we have a developper in our team that
directly execute queries to the livestatus module via commands like
printf 'GET hosts\nFilter: state = 1' | nc 10.197.64.97 50000 >
/data/ftptrace/nagios/thruk.txt
printf 'GET comments\nFilter comment_id = '$commid | nc 10.197.64.97 50000 |
tail -1 | awk -F";" '{print $2}'*

*This gives us informations about hosts down which are then reformatted in a
dusty old report sent to our client.
At the beginning we used only the first request for our report, as comments
were directly available from the host information given by the query. After
an update, we didn't realised that the comments were not directly in the
query result, but only the comment ID (which I grant you is much more
"clean")

1) Problem is that now, we need to query for the comments (selecting good
comment ID) and that it constantly break livestatus module (which doesn't
always manage to relaunch itself)

2) We also noted that when we use the Column statement (to select only the
columns we need), the livestatus module instantly crash

I realise that our problem is a little exotic, as the vast majority of
livestatus users only use it through Thruk, but if something could be done
(or as already been done), we would be grateful (our developper mostly :-p)

Denis GERMAIN

PS: An example traceback. I don't have much more yet, we are running Shinken
on production (I already see admins frowning eyes, but it's stable enough if
you don't try strange things like us) and my manager don't really like us
crashing it on purpose. We'll try to reproduce on preproduction ASAP, but if
this can help pinpointing the issue...

[1319536549] [broker-1] Traceback (most recent call last):
  File
"/usr/lib/python2.6/site-packages/shinken/modules/livestatus_broker/livestatus_broker.py",
line 828, in main
    self.do_main()
  File
"/usr/lib/python2.6/site-packages/shinken/modules/livestatus_broker/livestatus_broker.py",
line 1052, in do_main
    response, keepalive =
self.livestatus.handle_request(open_connections[socketid]['buffer'])
  File
"/usr/lib/python2.6/site-packages/shinken/modules/livestatus_broker/livestatus.py",
line 129, in handle_request
    request.parse_input(data)
  File
"/usr/lib/python2.6/site-packages/shinken/modules/livestatus_broker/livestatus_request.py",
line 96, in parse_input
    query.parse_input('\n'.join(query_cmds))
  File
"/usr/lib/python2.6/site-packages/shinken/modules/livestatus_broker/livestatus_query.py",
line 259, in parse_input
    self.filter_stack.put(self.make_filter(operator, attribute, reference))
  File
"/usr/lib/python2.6/site-packages/shinken/modules/livestatus_broker/livestatus_query.py",
line 786, in make_filter
    converter = self.find_converter(attribute)
  File
"/usr/lib/python2.6/site-packages/shinken/modules/livestatus_broker/livestatus_query.py",
line 102, in find_converter
    out_map = LSout_map[self.out_map_name]
KeyError: 'hosts'
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to