GithubHelp home page GithubHelp logo

voxpupuli / puppet-nsclient Goto Github PK

View Code? Open in Web Editor NEW
8.0 46.0 26.0 268 KB

Module that will install the NSClient on Windows

Home Page: https://forge.puppet.com/puppet/nsclient

License: MIT License

Ruby 50.79% Puppet 49.21%
puppet windows-puppet-module hacktoberfest

puppet-nsclient's Introduction

puppet-nsclient

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with nsclient
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

##Overview

This is a module that will manage and install the NSClient on Windows servers from the official NSClient site.

Build Status

##Module Description Module that will install the NSClient on windows servers to be able to interact with Nagios and Icinga. It will also manage the list of hosts that the server can communicate with.

##Setup

###What nsclient affects

  • Installs a new package
  • Creates a new windows service

###Beginning with nsclient

Usage

To install nsclient with defaults:

include 'nsclient'

To install a different version:

class { 'nsclient':
  package_source_location => 'http://myhost.com',
  package_name            => 'NSClient++ (Win32)'
  package_source          => '0.3.1.msi'
}

In order to configure the nagios hosts to communicate with:

class { 'nsclient':
  allowed_hosts => ['10.21.0.0/22','10.21.4.0/22'],
}

in order to use proxy for downloading the package

class { 'nsclient':
  proxy_url => 'http://proxy.domain.local:8080',
}

##Usage

###Classes and Defined Types

####Class: nsclient One of the primary classes of the nsclient module. This class will install the nsclient binaries

Parameters within nsclient: #####allowed_hosts Array of hosts that your client can communicate with. You can use netmasks (/ syntax) or * to create ranges.

#####service_state Whether you want to nsclient service to start up. Defaults to running

#####service_enable Whether you want to nsclient service to start up at boot. Defaults to true

#####package_source_location This is the default site to download your package from (e.g. http://files.nsclient.org/stable)

#####package_source This is the source name of the package to be downloaded

#####package_name This is name of the package to download (e.g. NSCP-0.4.1.101-x64.msi)

#####download_destination This is the folder to where we need to download the NSCP Installer. Package cannot take a remote file source Because of Windows, we need to set this to be a top level directory (e.g. c:\temp) or we would need to recursively check the file path.

#####config_template This is the template to use as the config file.

#####proxy_url Specify a proxy url if needed for downloading the package

#####password Password used to authenticate against server

##Reference

###Classes ####Public Classes

  • nsclient: Guides the basic installation of the nsclient application

####Private Classes

  • [nsclient::config] Manages all the default configuration of the nsclient application
  • [nsclient::install] Manages the installation of the nsclient
  • [nsclient::service] Manages the nclient service

##Limitations

This module is tested on the following platforms:

  • Windows 2008 R2

It is tested with the OSS version of Puppet only.

##Development

###Contributing

Please read CONTRIBUTING.md for full details on contributing to this project.

puppet-nsclient's People

Contributors

adamcrews avatar alexjfisher avatar andrewwippler avatar bastelfreak avatar bbriggs avatar dan33l avatar derektamsen avatar dhollinger avatar dhoppe avatar ekohl avatar empi89 avatar haf avatar hdep avatar igalic avatar juniorsysadmin avatar kenyon avatar liamjbennett avatar llowder avatar maxadamo avatar nibalizer avatar rnelson0 avatar rstuart-indue avatar sandra-thieme avatar smortex avatar stack72 avatar tragiccode avatar vinzent avatar yakatz avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-nsclient's Issues

Tests with FUTURE_PARSER="yes" are failing

When running PUPPET_GEM_VERSION="~> 3.0" STRICT_VARIABLES=yes FUTURE_PARSER="yes" bundle exec rake test on travis or on my desktop the tests fail on

  1) nsclient when trying to install on Ubuntu should contain Class[nsclient]
     Failure/Error: expect {
       expected Puppet::Error with message matching /^This module only works on Windows based systems./, got #<Puppet::Error: Evaluation Error: Error while evaluating a Function Call, This module only works on Windows based systems. at /Users/XXXX/puppet-nsclient/spec/fixtures/modules/nsclient/manifests/install.pp:41:7 on node XXXXX> with backtrace:....

I would suggest to remove the ^ from the test code.

Install_options not working on newer versions of nsclient.

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:Server: 2.6.0 , Client 4.8.1
  • Ruby: 2.1.9p490
  • Distribution: Windows Server 2012 R2
  • Module version: 1.4.0

How to reproduce (e.g Puppet code you use)

Called:
class { 'nsclient':
package_source_location => 'https://github.com/mickem/nscp/releases/download/0.5.0.62',
package_name => 'NSClient++ (x64)',
package_source => 'NSCP-0.5.0.62-x64.msi',
}

What are you seeing

Install fails as the Custom Properties applied to the install are failing. The package can't be installed with either of the properties INSTALLLOCATION or CONFIGURATION_TYPE. Also fails manually.

What behaviour did you expect instead

Silent install. I get a popup from msiexec.

Any additional information you'd like to impart

Tried version 4.3, 5.0 and 5.1 of nsclient. Neither of them worked.
It seems dangerous to assume the package contains the mentioned custom properties. I'll look into a PR to make them optional.

Is this module still being maintained?

Seeing as the last version was from 5 years ago, and the dependencies still reflect that, I would like to know if this module is still being maintained or if I should be looking for an alternative.

Add support for upgrades

The ability to upgrade from one to another doesn't work since the package definition in the install.pp manifest file only says ensure => installed rather than ensure => $version

Add support for proxy

Hello,

if I'm not wrong this module doesn't support proxy configuration for download_file is this right ?

Regards,

Add password field

I'ld like to be able to do something like this

class { 'nsclient':
  allowed_hosts => ['192.168.135.0/24'], 
  password => hiera('compagny::nsclient::password')
}

This plugin should not use mode

Hi,

this module should not set 'mode' for nsclient.ini because this is not well managed by windows. For example, in my environment I use a provided template, puppet constantly try to set mode permission, but fails silently. To solve this we can just let default permission. Moreover currenlty mode is hardcoded so I don't get any chance to fix the issue quickly.

If we want more precise permissions, we need to use ACL mechanism :

Info: Applying configuration version '1545637771'
Notice: /Stage[main]/Nsclient::Service/File[C:\Program Files\NSClient++\nsclient.ini]/mode: mode changed '0774' to '0664
'
Info: /Stage[main]/Nsclient::Service/File[C:\Program Files\NSClient++\nsclient.ini]: Scheduling refresh of Service[nscp]

Notice: /Stage[main]/Nsclient::Service/Service[nscp]: Triggered 'refresh' from 1 event
Notice: Applied catalog in 17.63 seconds

Download of msi failed due to default tls version

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.3
  • Ruby: ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
  • Distribution: Debian Stretch
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

include 'nsclient'

What are you seeing

msi package fails to download when executing download-NSCP-0.5.1.28-x64.ps1

What behaviour did you expect instead

msi package downloaded to c:\temp

Output log

System.Net.WebException
The request was aborted: Could not create SSL/TLS secure channel.

The request was aborted: Could not create SSL/TLS secure channel.
At C:\temp\download-NSCP-0.5.1.28-x64.ps1:32 char:3

  • throw $_.Exception
  • + CategoryInfo          : OperationStopped: (:) [], WebException
    + FullyQualifiedErrorId : The request was aborted: Could not create SSL/TLS secure channel.
    

Any additional information you'd like to impart

By default powershell uses TLS 1.0 the site security requires TLS 1.2
I added [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 after try on line 25 of powershell script.

try {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile('https://github.com/mickem/nscp/releases/download/0.5.1.28/NSCP-0.5.1.28-x64.msi', 'c:/temp\NSCP-0.5.1.28-x64.msi')
}

Improve the default template

I have received comments about this module where the user is using config_template argument to specific a custom template because the default template is too limiting to meet their needs. This is not great.

While the config_template option is a great option to have, when building a ini file with a lot of configuration options (that may differ between environments), it would be useful for the default template to support as many options as possible.

There are obviously a lot of configuration options here but it would be good to be able to have the module build the template from a hash or a number of hashes rather than a long list of arguments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.