×


Need at least 2 WMI samples% - Fix it Now ?

Recently one of our customers came across this error after executing the checkcpu wmi check. This can be due to permission issues.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Nagios queries.

In this context, we shall look into how to fix this WMI error.


Nature of error, Need at least 2 WMI samples%

A part of the Windows operating system, Windows Management Instrumentation (WMI) can provide management data and operational information about those systems.

We can use WMI to automate administrative tasks on remote Windows-based computers.

Nagios Core and Nagios XI are capable of monitoring Windows machines via WMI.

Before we go on to the resolution, let us see how the error, "Need at least 2 WMI samples%" looks like.

We see this error message after executing checkcpu wmi check repeatedly:

[root@server ~]# /opt/nagios/bin/plugins/check_wmi_plus.pl -H nagiosserver -u wmiagent -p xxxxx -m checkcpu
OK (Sample Period 5 sec) – Average CPU Utilisation Need at least 2 WMI samples%
[root@server ~]# /opt/nagios/bin/plugins/check_wmi_plus.pl -H nagiosserver -u wmiagent -p xxxxx -m checkcpu
OK (Sample Period 1 sec) – Average CPU Utilisation Need at least 2 WMI samples%
[root@server ~]# /opt/nagios/bin/plugins/check_wmi_plus.pl -H nagiosserver -u wmiagent -p xxxxx -m checkcpu
OK (Sample Period 1 sec) – Average CPU Utilisation Need at least 2 WMI samples%
[root@server ~]# /opt/nagios/bin/plugins/check_wmi_plus.pl -H nagiosserver -u wmiagent -p xxxxx -m checkcpu
OK (Sample Period 1 sec) – Average CPU Utilisation Need at least 2 WMI samples%
[root@server ~]# /opt/nagios/bin/plugins/check_wmi_plus.pl -H nagiosserver -u wmiagent -p xxxxx -m checkmem
OK – Physical Memory: Total: 3.999GB – Used: 2.19GB (55%) – Free: 1.809GB (45%)|’Physical Memory Used’=2351108096Bytes; ‘Physical Memory Utilisation’=55%;


The reason for the message is that the WMI user account does not have sufficient permissions.


In order to solve this, we add the user account to the Performance Log Users security group on the Windows computer.

We can perform this by following the steps given below:

  • Initially, we open the Computer Management console in Administrative tools.
  • Then we expand System Tools > Local Users and Groups > Groups.
  • Finally, we edit the Performance Log Users security group and add the user account to this group.


[Couldn't fix this Nagios error? We'd be happy to help you. ]


Conclusion

This article covers how to tackle the error, Need at least 2 WMI samples%. The reason for the message is that the WMI user account does not have sufficient permissions. This can be resolved by adding the user account to the Performance Log Users security group on the windows computer. 

  • This can be performed by opening the Computer Management console (located in Administrative tools). 
  • Expand System Tools > Local Users and Groups > Groups. 
  • Edit the Performance Log Users security group and add the user account (wmiagent) to this group.