check_http with a single string

Julen Larrucea <[email protected]> Tue, 16 Apr 2019 20:24:29 +0200
Newsgroups gmane.network.nagios.devel
Message-ID <CA+yC+7zT_+JEENy-Py1iXHrGgdmpuxCzzuepiewPau3vJPtdhA__31594.2946866684$1557481243$gmane$org@mail.gmail.com>
--000000000000d589160586a9e14d
Content-Type: text/plain; charset="UTF-8"

Hi there,

The check_http plugin is excellent and has tons of options for every use
case, but I have a "feature request".

Would it be possible to make it accept a single parameter with all of the
(most common) information?
Examples:

- check_http -X http://example.com:82
- check_http -X https://username:[email protected]/login

This way, we could use a single list of strings (for example in icinga2
host.vars.vhosts) and easily cover all the virtual hosts in a machine
without complex dictionaries and exceptions.

I wrote a wrapper which parses the values and calls check_http with the
right parameters, but it would be cleaner to have it built-in into the
plugin itself.
Unfortunately I am not so good at C :(  but for someone who can, and is
familiar with the plugin, it should be relatively simple. Just parse the
sting some some regexp-es and assign the parsed variables to the existing
ones in the plugin.

Any thoughts?

  Best regards

--
Dr. Julen Larrucea
http://www.larrucea.eu

  Fraunhofer IFAM
  Bremen - Germany

--000000000000d589160586a9e14d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi there,<br><br>The check_http plugin is excellent and ha=
s tons of options for every use case, but I have a &quot;feature request&qu=
ot;.<br><br>Would it be possible to make it accept a single parameter with =
all of the (most common) information?<br>Examples:<br><br>- check_http -X <=
a href=3D"http://example.com:82">http://example.com:82</a><br>- check_http =
-X <a href=3D"https://username:[email protected]/login">https://username=
:[email protected]/login</a><br><br>This way, we could use a single list=
 of strings (for example in icinga2 host.vars.vhosts) and easily cover all =
the virtual hosts in a machine without complex dictionaries and exceptions.=
<div><br></div><div>I wrote a wrapper which parses the values and calls che=
ck_http with the right parameters, but it would be cleaner to have it built=
-in into the plugin itself.</div><div>Unfortunately I am not so good at C :=
(=C2=A0 but for someone who can, and is familiar with the plugin, it should=
 be relatively simple. Just parse the sting some some regexp-es and assign =
the parsed variables to the existing ones in the plugin.<br><br>Any thought=
s?</div><div><br></div><div>=C2=A0 Best regards</div><div><br>--<br>Dr. Jul=
en Larrucea <br><a href=3D"http://www.larrucea.eu">http://www.larrucea.eu</=
a><br><br>=C2=A0 Fraunhofer IFAM<br>=C2=A0 Bremen - Germany</div></div>

--000000000000d589160586a9e14d--