I am trying to install NSClient on windows 2008r2 using the below manifest
class nsclient ($nagiosservers) {
if ($operatingsystem == "windows") {
file { 'C:/NSClient':
ensure => directory,
owner => 'Administrator',
mode => '0755',
}
file { 'C:/NSClient/NSClient-0.3.9-x64.msi':
ensure => present,
owner => 'Administrator',
mode => '0755',
source => "puppet:///modules/nsclient/NSClient-0.3.9-x64.msi",
require => File['C:/NSClient'],
}
package { 'NSClient++ (x64)':
ensure => installed,
provider => 'windows',
source => "C:\\NSClient\\NSClient-0.3.9-x64.msi",
require => File['C:/NSClient/NSClient-0.3.9-x64.msi'],
}
service { 'NSClient++ (x64)':
ensure => running,
enable => true,
require => Package['NSClient++ (x64)'],
}
file { 'C:/Program Files/NSClient++/NSC.ini':
ensure => file,
owner => 'Administrator',
mode => '0755',
content => template("nsclient/NSC.ini.erb"),
require => Package['NSClient++ (x64)'],
notify => Service['NSClient++ (x64)'],
}
file { 'C:/Program Files/NSClient++/scripts/check_bkp.bat':
ensure => file,
owner => 'SYSTEM',
mode => '0755',
source => 'puppet:///modules/nsclient/check_bkp.bat',
require => Package['NSClient++ (x64)'],
}
}
else {
fail('This module is only supported on windows')
}
}
I get the following errors during the initial run
Info: /Stage[main]/Nsclient/File[C:/Program Files/NSClient++/NSC.ini]: Scheduling refresh of Service[NSClient++ (x64)]
Error: /Stage[main]/Nsclient/Service[NSClient++ (x64)]: Could not evaluate: Cannot get status of NSClient++ (x64), error was: The specified service does not exist as an installed service.
Error: /Stage[main]/Nsclient/Service[NSClient++ (x64)]: Failed to call refresh: Cannot get status of NSClient++ (x64), error was: The specified service does not exist as an installed service.
Error: /Stage[main]/Nsclient/Service[NSClient++ (x64)]: Cannot get status of NSClient++ (x64), error was: The specified service does not exist as an installed service.
If I run the following to list the services
sc queryex type= service state= all | find "DISPLAY_NAME"
There is a row that says "DISPLAY_NAME: NSClient++ (x64)" so the service is there puppet is just not starting it.
any more runs of the agent return this error
Error: /Stage[main]/Nsclient/Service[nsclient]: Could not evaluate: Cannot get status of NSClient++ (x64), error was: The specified service does not exist as an installed service.
puppetmaster : 3.2.3
puppet agent : 3.1.1
Is there something wrong with my config or is puppet having a hard time with the special characters in the service display name ?