💾 Archived View for gemini.bortzmeyer.org › software › manisha captured on 2024-08-18 at 23:12:53. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

Manisha

Manisha is a Nagios (and compatible) monitoring plug-in to test Gemini

servers. It allows to test automatically if the servers work fine from

monitoring schedulers like Nagios or Icinga. It can test the status

code, the content of the answer, etc.

Manisha is written in Python.

Monitoring plugins

Icinga

Download

The Manisha script

Usage

Manisha follows the usual Nagios rules. The options are:

For Icinga, the following definition enables the plugin:

object CheckCommand "gemini" {
  command = [ PluginContribDir + "/check_gemini" ]

  arguments = {
     "-H" = {{
	   var v6only = macro("$gemini_forceipv6$")
	   var v4only  = macro("$dot_forceipv4$")
	   var addr_v4 = macro("$address$")
	   var addr_v6 = macro("$address6$")
           if ((addr_v6 && !v4only) || v6only) {
		return addr_v6
	   } else {
		return addr_v4
	   }
	   }},
      "-V" = "$gemini_vhost$",
      "-e" = "$gemini_expect$",
      "-c" = "$gemini_expect_statuscode$",
      "-C" = "$gemini_certificate$",
      "-m" = "$gemini_expect_meta$",
      "-p" = "$gemini_path$",
      "-P" = "$gemini_port$",
      "-s" = "$gemini_proxy$",	    
      "-i" = { set_if =	"$gemini_insecure$" },
      "-T" = { set_if =	"$gemini_no_tofu$" },
      "-a" = { set_if =	"$gemini_accept_expired$" },
      "-x" = { set_if = "$gemini_nosni$" },
      "-g" = { set_if = "$gemini_get_content$" },
      "-4" = "$gemini_force_ipv4$",
      "-6" = "$gemini_force_ipv6$"
  }

}

And a possible use is:

apply Service for (gemini_vhost => config in host.vars.gemini_vhosts) {
  import "generic-service"

  check_command = "gemini"
  assign where (host.address || host.address6) && host.vars.gemini
  vars += config
}

object Host "radia" {
...
  vars.gemini_vhosts["vhost1"] = {
      gemini_expect = "This is virtual host 1"
      gemini_vhost = "vhost1.example"
   }

  vars.gemini_vhosts["vhost2"] = {
      gemini_expect = "This is virtual host 2"
      gemini_vhost = "vhost2.example"
   }


Installation

You need Python 3 and Agunua. You can install Agunua with pip `pip3

install agunua`.

Then, copy the script `check_gemini.py` to the directory of local

plugins.

Agunua

Name

Manisha is the girlfriend of Gemini in the 2002 movie "Gemini", by Saran.

License

GPL.

Authors

Stéphane Bortzmeyer <stephane+framagit@bortzmeyer.org>.

Reference site

[Web] Reference site with Gitlab for bugs or wishes.