Hi

Now i finally got everything working and this is what i'm using.
object CheckCommand "nrpe-volume" {
import "nrpe"
vars.nrpe_command = "check_drivesize"
vars.nrpe_arguments = [ "drive=$volume$", "warn=free<$nrpe_warn$",
"crit=free<$nrpe_crit$", "show-all" ]
vars.nrpe_warn = "5%"
vars.nrpe_crit = "2%"
}

apply Service for (nrpe_volume_windows => config in host.vars.volumes) {
import "generic-service"
display_name = nrpe_volume_windows
check_command = "nrpe-volume"
vars += config
assign where host.vars.os == "Windows"
}

template Host "template-host-windows" {
import "generic-host"
vars.os = "Windows"
vars.volumes["volume_c"] = { volume = "c" }
vars.volumes["volume_d"] = { volume = "d" }
}

object Host "adm-cert-hand-1" {
import "template-host-windows"
address = "10.190.91.24"
}

Any comments or something i can make better or more flexible is apreciated

Brian Møller


2015-07-31 9:41 GMT+02:00 Brian Møller <[email protected]>:

> Hi
>
> Thanks for the hint. I change the vars.nrpe_arguments to:
> vars.nrpe_arguments =  [ "drive=$volume$", "warn=free<$nrpe_warn$",
> "crit=free<$nrpe_crit$" ]
>
> That is at runtime parsed to:
> Running command '/usr/lib64/nagios/plugins/check_nrpe' '-H' '10.190.91.24'
> '-c' 'CheckDriveSize' '-a' 'drive=d:' 'warn=free<5%' 'crit=free<2%'
> My problem is that the ' around the drive=d: and so forth makes NSclient++
> return that it cannot find that drive or folder and therefor fails.
>
> Is there a workaround for that or am i missing something important?
>
> Brian
>
> 2015-07-30 13:40 GMT+02:00 Alexander Wirt <[email protected]>:
>
>> On Thu, 30 Jul 2015, Brian Møller wrote:
>>
>> > Hi all
>> >
>> > I apologize if this question has been asked before, but i havent been
>> able
>> > to find it anywhere.
>> >
>> > I'm in the process of migrating from Icinga 1.x to Icinga2 2.x and i
>> have
>> > run into a problem that i havent found a solution for.
>> >
>> > I have made this checkcommand object, to be run against a Windows server
>> > with NSClient++ 0.4.3 (it imports the standard NRPE-checkcommand in
>> > Icinga2):
>> > object CheckCommand "nrpe-volume" {
>> > import "nrpe"
>> > vars.nrpe_command = "CheckDriveSize"
>> > vars.nrpe_arguments = "drive=$nrpe_volume$ warn=free<$nrpe_warn$
>> use an array instead of a string.
>>
>> Alex
>>
>> _______________________________________________
>> icinga-users mailing list
>> [email protected]
>> https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>
>
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to