[LRUG] Working with bogus URLs

David Salgado david at digitalronin.com
Sat Oct 8 06:21:07 PDT 2011


Hi All

I'm trying to write a gem to interact with the REST API of Icinga (a
monitoring system which is a fork of Nagios). My problem is that the
"URLs" used to call the API are not valid. Here is an example;

http://localhost/icinga-web/web/api/service/filter[AND(SERVICE_NAME|=|In%20service;AND(SERVICE_CURRENT_STATE|!=|0))]/countColumn=SERVICE_ID/authkey=xxxxx/json

Put that into URI.parse and it blows up with;

bad URI(is not URI?)

...which is fair enough.

I can get what I want using wget inside backticks, but does anyone
know of a ruby library that will accept badly formed URLs like this?

Thanks in advance

David



More information about the Chat mailing list