Nagios check_dns plugin support of querytype

I am wondering if it is possible to request to update the current Nagios Plugin ‘check_dns’ that comes with CheckMK installation.

# /omd/sites/corpnms/lib/nagios/plugins/check_dns -V
check_dns v2.3 (monitoring-plugins 2.3)

I have a use case to use the ‘querytype’ parameter for a check which looks to be available in
v2.3.3 on the nagios plugins site.

If the plugin was updated and incorporated the additional available option (-q, --querytype) in the web UI, it would avoid doing some customization.

As an alternative, I’m guessing I should be able to download that plugin, compile it and move it to the appropriate plugin folder on the checkmk server with an alternate name such as check_dns_type. Once located there I can leverage the rule ‘Integrate Nagios plugins’ to apply to this new check with the additional options.

Just making sure it’s as simple as I think it is but the update option would be preferred.

Thank you in advance for the help and reading,
Scotsie

1 Like

You can always put a newer version into $OMD_ROOT/local/lib/nagios/plugins. This should then get picked up by the configuration.

1 Like

That’s what I first wanted to suggest as well. But then you still don’t have input fields in the setup rule form for the new options.

As a workaround, the updated local plugin can be included with “Setup > Services > Other services > Integrate Nagios plugins” where the full command line including any required options can be given.

2 Likes

Thanks, that was my assumption. After posting this I decided to to try it out on a temporary Checkmk server which worked.

  1. Downloaded the plugin from the site link above to a test CentOS server (same version/build as CheckMK) to avoid file conflicts.
  2. Followed the instructions for extracting and compiling.
  3. Copied the compiled plugin to the test checkmk $OMD_ROOT path, which in my case is:
    /omd/sites/corpnms/local/lib/nagios/plugins/check_dns_type
  4. In the CheckMK WebUI, created a new rule under ‘Integrate Nagios plugins’ with the syntax:
    check_dns_type -H <domain> -s $HOSTADDRESS$ -q MX -w 2 -c 3 -t 60 -a '10 mx1.<domain>.,20 mx2.<domain>.'

When it worked I repeated this on our production checkmk server.

As a side note, I tried supplying the -a ‘expected answers’ parameter with 2 entries but had to combine it.
With this setup:
`check_dns_type -H example.com -s $HOSTADDRESS$ -q MX -w 2 -c 3 -t 60 -a ‘10 mx1.example.com.’ -a ‘20 mx2.example.com.’
Something, either the plugin or checkmk, inserted a semicolon between responses which caused it to flag as a mismatch in the actual check.

Hope this helps the next person.

Scotsie

Please do not put anything under /omd/versions yourself. You will lose it after an update. Any extension has to be put under $OMD_ROOT/local of your site.

1 Like

Thank you, I have moved the file to this path and updated my steps above.

With the “Integrate Nagios plugins” Rule you can run all Nagios Plungin like you would on the commandline.

In this case you could place your version of the plugin with a diffrent name like check_dns_223 in $OMD_ROOT/local/lib/nagios/plugins and than use the “Integrate Nagios plugins” Rule to execute the Plugin with the Arguments you need.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.