diff --git a/centreon-plugins/os/windows/local/mode/pendingreboot.pm b/centreon-plugins/os/windows/local/mode/pendingreboot.pm index 54d97aabc..8fd24ba25 100644 --- a/centreon-plugins/os/windows/local/mode/pendingreboot.pm +++ b/centreon-plugins/os/windows/local/mode/pendingreboot.pm @@ -42,7 +42,7 @@ sub custom_status_threshold { eval "$instance_mode->{option_results}->{critical_status}") { $status = 'critical'; } elsif (defined($instance_mode->{option_results}->{warning_status}) && $instance_mode->{option_results}->{warning_status} ne '' && - eval "$instance_mode->{option_results}->{warning_status}") { + eval "$instance_mode->{option_results}->{warning_status}") { $status = 'warning'; } }; @@ -56,7 +56,13 @@ sub custom_status_threshold { sub custom_status_output { my ($self, %options) = @_; - my $msg = 'Reboot Pending : ' . $self->{result_values}->{RebootPending}; + my $msg = sprintf('Reboot Pending: %s [Windows Update: %s][Component Based Servicing: %s][SCCM Client: %s][File Rename Operations: %s][Computer Name Change: %s]', + $self->{result_values}->{RebootPending}, + $self->{result_values}->{WindowsUpdate}, + $self->{result_values}->{CBServicing}, + $self->{result_values}->{CCMClientSDK}, + $self->{result_values}->{PendFileRename}, + $self->{result_values}->{PendComputerRename}); return $msg; } @@ -67,6 +73,8 @@ sub custom_status_calc { $self->{result_values}->{RebootPending} = $options{new_datas}->{$self->{instance} . '_RebootPending'}; $self->{result_values}->{WindowsUpdate} = $options{new_datas}->{$self->{instance} . '_WindowsUpdate'}; $self->{result_values}->{CCMClientSDK} = $options{new_datas}->{$self->{instance} . '_CCMClientSDK'}; + $self->{result_values}->{PendComputerRename} = $options{new_datas}->{$self->{instance} . '_PendComputerRename'}; + $self->{result_values}->{PendFileRename} = $options{new_datas}->{$self->{instance} . '_PendFileRename'}; return 0; } @@ -79,7 +87,7 @@ sub set_counters { $self->{maps_counters}->{pendingreboot} = [ { label => 'status', , threshold => 0, set => { key_values => [ { name => 'CBServicing' }, { name => 'RebootPending' }, { name => 'WindowsUpdate' }, - { name => 'CCMClientSDK' } ], + { name => 'CCMClientSDK' }, { name => 'PendComputerRename' }, { name => 'PendFileRename' } ], closure_custom_calc => $self->can('custom_status_calc'), closure_custom_output => $self->can('custom_status_output'), closure_custom_perfdata => sub { return 0; }, @@ -191,12 +199,14 @@ Print powershell output. =item B<--warning-status> Set warning threshold for status (Default: '%{RebootPending} =~ /true/i'). -Can used special variables like: %{RebootPending}, %{CBServicing}, %{WindowsUpdate}, %{CCMClientSDK}. +Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, +%{PendFileRename}, %{PendComputerRename}. =item B<--critical-status> Set critical threshold for status (Default: ''). -Can used special variables like: %{RebootPending}, %{CBServicing}, %{WindowsUpdate}, %{CCMClientSDK}. +Can used special variables like: %{RebootPending}, %{WindowsUpdate}, %{CBServicing}, %{CCMClientSDK}, +%{PendFileRename}, %{PendComputerRename}. =back