Plugin win_dhcp_pools

CMK version: 2.3.0p19
OS version: Windows Server 2022

Error message: No detection of services

I have added the plugin ‘win_dhcp_pools’ in the path ‘C:\ProgramData\checkmk\agent\plugins’ on a Windows machine. I have configured the rule ‘Windows DHCP pool discovery’ with the values ‘Discovery of service DHCP pools’ and ‘Include empty pools into the monitoring’ activated,

but when I rescan the services I detect the service ‘DHCP Stats’ and no other service.

image

When I run the ‘win_dhcp_pools’ script on the machine I get the data from several DHCP scopes.

Is any additional configuration necessary?

Thank you very much.

Hi juanco,

usually this script works out of the Box.
You can try to download the agent output of that host and see, if the dhcp pool data is in there.

If not, I would test the plugin as the local system account on the windows server to see if there are any rights/permission problems and inspect the logs of the agent in the programdata logs folder.

If the data is in the output, you can check, if there are disabled service rules, that hide those services.

Hello.

Thank you for your reply. I have checked that I get the data of all DHCP scopes by running the script ‘win_dhcp_pools.bat’.
If I see the data I get from the checkmk server with the command -d ‘cmk server_dhcp_name’ | grep Subnet’ I can see the data. But checkmk does not discover new services with these dhcp ranges.

image

I currently have the plugins mk_dhcp_enabled and win_dhcp_pools, but I can only see the DHCP Stats service.

image

image

Hi,

my output looks like this. Can you compare that to your output (Dowload Agent Output) :

<<<win_dhcp_pools>>>


MIBCounts:
	Discovers = 326357.
	Offers = 320613.
	Delayed Offers = 0.
	Requests = 380683.
	Acks = 362987.
	Naks = 182.
	Declines = 38.
	Releases = 1223.
	ServerStartTime = Montag, 9. Dezember 2024 12:48:49   
	Scopes = 2.
	Scopes with Delay configured= 0.
	Subnet =10.1.1.0.
		No. of Addresses in use = 1.
		No. of free Addresses = 765.
		No. of pending offers = 0.
	Subnet = 10.2.1.0.
		No. of Addresses in use = 0.
		No. of free Addresses = 766.
		No. of pending offers = 0.

Hi Juanjo,

Apparently you are using a Spanish edition Windows. Some time ago I had a similar issue and wrote this PowerShell to translate the Spanish output to English as checkmk expects:

# Script para usar en servidores instalados en español

$translate = @( 
				("Descubre", "Discovers"), 
				("Ofrece", "Offers"),
				("Solicita", "Requests"),
				("Declina", "Declines"),
				("Libera", "Releases"),
				("Subred", "Subnet"),
				("Ámbitos", "Scopes"),
				("Núm. de direcciones en uso", "No. of Addresses in use"),
				("Núm. de direcciones libres", "No. of free Addresses"),
				("Núm. de ofertas pendientes", "No. of pending offers")
			)

$dhcpinfo = netsh dhcp server show mibinfo

foreach($value in $translate)
{
	$dhcpinfo = $dhcpinfo -replace $value[0],$value[1]
}
echo `<`<`<win_dhcp_pools`>`>`>
echo $dhcpinfo

just save it as win_dhcp_pools.ps1

Hope it helps!

Regards,

Alejandro

2 Likes

Thank you!!

My output looks like it.

I think that alejandro has posted the right solution for you.
The problem is the spanish output that the check plugin does not understand.
If you take a look at the check Plugin ~/lib/python3/cmk/base/plugins/agent_based/win_dhcp_pools.py _WIN_DHCP_POOLS_STATS_TRANSLATE you can see that there are translations only for the german language.

1 Like

Thank you very much.

That solution works for me now!!

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.