Page 1 of 1

NRPE Check fails

Posted: Mon Mar 06, 2017 8:49 pm
by kwhogster
Nagios 4.1 core

I have this on 4 Domain Controls and this one keeps getting this error

Code: Select all

define service{
        use                     generic-service
        host_name               TGCS002
        service_description     AD
        check_command           check_nrpe!checkDC
        servicegroups           AD Check
        }
The nsclient

checkDC = cscript.exe //T:30 //NOLOGO scripts\\check_ad.vbs $ARG1

This appears several times a day.

TGCS002 This host has 1 comment associated with it AD Notifications for this service have been disabled UNKNOWN 03-06-2017 20:31:22 0d 0h 32m 22s 3/3 The command (checkdc) returned an invalid return code: 128

Can this ben changed to only check once a week?

Why is it causing this error

Re: NRPE Check fails

Posted: Tue Mar 07, 2017 12:48 pm
by mcapra
Assuming the exit code 128 is from cscript, I have no idea. I found this technet article that indicates some of the libraries needed may not be initializing, or that adequate resources are unavailable:
https://support.microsoft.com/en-us/hel ... initialize

It can also happen when cscript is running more than 1 script. Perhaps you have some cscript executions that are hung?

Re: NRPE Check fails

Posted: Tue Mar 07, 2017 8:41 pm
by kwhogster
How can I run this check only once a week?

Re: NRPE Check fails

Posted: Wed Mar 08, 2017 4:03 pm
by mcapra
1 week is 10080 minutes, so you should be able to set your Nagios object's check_interval to that.

Re: NRPE Check fails

Posted: Wed Mar 08, 2017 9:16 pm
by kwhogster
I added that to 3 of my service definitions

Got these warnings

Warning: Service 'Guest Snapshots' on host 'TGKW009' has a notification interval less than its check interval! Notifications are only re-sent after checks are made, so the effective notification interval will be that of the check interval.
Warning: Service 'NSClient++ Version' on host 'TGKW009' has a notification interval less than its check interval! Notifications are only re-sent after checks are made, so the effective notification interval will be that of the check interval.
Warning: Service 'WSUS' on host 'TGKW009' has a notification interval less than its check interval! Notifications are only re-sent after checks are made, so the effective notification interval will be that of the check interval.

My services

Code: Select all

define service{
        use                     generic-service
        host_name               TGKW009
        service_description     NSClient++ Version
        servicegroups           nsclients
        check_interval          10080
        check_command           check_nt!CLIENTVERSION
        check_period            backup_time
        notification_period     backup_time
        }
define service{
        use                     generic-service
        host_name               TGKW009
        service_description     WSUS
        check_interval          10080
        check_command           check_ms_win_updates
        servicegroups           Windows Updates
        }
define service {
        host_name TGKW009
        service_description Guest Snapshots
        check_command box293_check_vmware_test!10.2.8.8!Guest_Snapshot!--guest!TGKW009!--warning!snapshot_age:30!--critical!snapshot_age:45
        initial_state u
        max_check_attempts 3
        check_interval 10080
        retry_interval 7
        active_checks_enabled 1
        check_period 24x7
        servicegroups   VMSnapShots
        register 1
}

My Template

Code: Select all

define host{
        name                    windows-desktop-vm
        use                     generic-host
        check_period            24x7
        check_interval          5
        retry_interval          1
        max_check_attempts      10
        check_command           check-host-alive
        notification_period     24x7
        notification_interval   30
        notification_options    d,r
        contact_groups          admins
        hostgroups              windows-desktops-vm
        register                0
        }
What should the notification level be set at then?

Re: NRPE Check fails

Posted: Thu Mar 09, 2017 9:52 am
by mcapra
You could bump it up to be the same as your check_interval, but those warnings can be safely ignore in this case. All they are telling you is that, since your check_interval is greater than your notification_interval, the effective notification_interval is equal to the check_interval. That might be a problem for some setups, but in this case the 1-week check_interval is deliberate.

Re: NRPE Check fails

Posted: Thu Mar 09, 2017 8:57 pm
by kwhogster
I did this and it is working

Code: Select all

define service{
        use                     generic-service
        host_name               TGKW009
        service_description     NSClient++ Version
        servicegroups           nsclients
        check_interval          10080
        notification_interval   0
        check_command           check_nt!CLIENTVERSION
        check_period            backup_time
        notification_period     backup_time
        }
That works

Any thoughts

Re: NRPE Check fails

Posted: Fri Mar 10, 2017 2:12 pm
by mcapra
No additional thoughts, but if it's working that's good!

Re: NRPE Check fails

Posted: Sun Mar 12, 2017 12:37 pm
by kwhogster
Lets lock this one now

seems to be working now.

Have another issue to post will do later

Re: NRPE Check fails

Posted: Mon Mar 13, 2017 12:34 pm
by cdienger
Thanks for the update. We'll close this thread.