example42 / puppet-nrpe Goto Github PK
View Code? Open in Web Editor NEWNrpe Puppet Module
Home Page: http://www.example42.com
License: Other
Nrpe Puppet Module
Home Page: http://www.example42.com
License: Other
Hi, I want to disable the installation of pluginspackage "nagios-plugins-all" and instead install a few defined plugins such as nagios-plugins-ssh, nagios-plugins-disk, nagios-plugins-procs-1.4.16-10.el6.x86_64...
So I tried the following code:
$nrpeplugins = ['nagios-plugins-ssh','nagios-plugins-disk']
class { '::nrpe':
allowed_hosts => 'nagios.myhost.be',
dont_blame_nrpe => '0',
use_ssl => false,
pluginspackage => $nrpeplugins,
}
This generates the following error:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid argument of type 'Array' to 'defined' at /etc/puppetlabs/puppet/environments/production/modules/nrpe/manifests/init.pp:518 on node
Is there a way to pass an array of plugins that I want to see installed?
My Call from Nagios Master:
/usr/local/nagios/libexec/check_nrpe -H 10.1.1.1 -c check_port_tcp -a localhost 19999
NRPE Config on target:
dont_blame_nrpe=1
command[check_port_tcp]=/usr/lib/nagios/plugins/check_tcp -H "$ARG1$" -p "$ARG2$"
Error Message:
service nagios-nrpe-server status
● nagios-nrpe-server.service - Nagios Remote Plugin Executor
Loaded: loaded (/lib/systemd/system/nagios-nrpe-server.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-08-22 17:34:37 UTC; 13min ago
Docs: http://www.nagios.org/documentation
Main PID: 18239 (nrpe)
CGroup: /system.slice/nagios-nrpe-server.service
└─18239 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -f
Aug 22 17:43:28 db01 nrpe[24300]: Error: Request contained command arguments!
Client request from 10.1.1.2 was invalid, bailing out...
Google says:
This package is built without support for command argument processing. If you
want to enable it, you will have to rebuild this package with
--enable-command-args in debian/rules
But there is no Option in Puppet package nrpe
Usage:
class { 'nrpe':
allowed_hosts => ['127.0.0.1', $::ipaddress],
use_ssl => true,
dont_blame_nrpe => '1',
}
Facts:
facter -p
apt_has_updates => true
apt_package_updates => ["openssh-sftp-server", "openssh-server", "openssh-client"]
apt_reboot_required => false
apt_security_updates => 3
apt_update_last_success => -1
apt_updates => 3
architecture => amd64
augeasversion => 1.8.0
blockdevice_xvda_size => 106837311488
blockdevice_xvdb_size => 536870912
blockdevices => xvda,xvdb
env_temp_variable => /tmp
facterversion => 2.4.6
filesystems => btrfs,cramfs,ext2,ext3,ext4,gfs2,gfs2meta,iso9660,jfs,minix,msdos,reiserfs,romfs,udf,vfat,xfs
fqdn => db01.lets-bastel.de
gid => root
hardwareisa => unknown
hardwaremodel => x86_64
hostname => db01
id => root
interfaces => dummy0,eth0,eth0_0,gre0,gretap0,ip6_vti0,ip6gre0,ip6tnl0,lo,sit0,teql0,tunl0
ipaddress => 134.119.10.123
ipaddress_eth0 => 134.119.10.123
ipaddress_eth0_0 => 10.1.26.124
ipaddress_lo => 127.0.0.1
is_pe => false
is_virtual => true
kernel => Linux
kernelmajversion => 4.4
kernelrelease => 4.4.110-x86_64-jb1
kernelversion => 4.4.110
last_run => Wed Aug 22 17:51:04:775369316 UTC 2018
lsbdistcodename => stretch
lsbdistdescription => Debian GNU/Linux 9.5 (stretch)
lsbdistid => Debian
lsbdistrelease => 9.5
lsbmajdistrelease => 9
lsbminordistrelease => 5
mco_confdir => /mcollective/etc
memoryfree => 3.59 GB
memoryfree_mb => 3673.18
memorysize => 3.90 GB
memorysize_mb => 3998.23
mtu_dummy0 => 1500
mtu_eth0 => 1500
mtu_eth0_0 => 1500
mtu_gre0 => 1476
mtu_gretap0 => 1462
mtu_ip6_vti0 => 1500
mtu_ip6gre0 => 1448
mtu_ip6tnl0 => 1452
mtu_lo => 65536
mtu_sit0 => 1480
mtu_teql0 => 1500
mtu_tunl0 => 1480
(Debian 9.1)
operatingsystem => Debian
operatingsystemmajrelease => 9
operatingsystemrelease => 9.5
os => {"name"=>"Debian", "family"=>"Debian", "release"=>{"major"=>"9", "minor"=>"5", "full"=>"9.5"}, "lsb"=>{"distcodename"=>"stretch", "distid"=>"Debian", "distdescription"=>"Debian GNU/Linux 9.5 (stretch)", "distrelease"=>"9.5", "majdistrelease"=>"9", "minordistrelease"=>"5"}}
osfamily => Debian
package_provider => apt
path => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
physicalprocessorcount => 1
processor0 => Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
processor1 => Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
processorcount => 2
processors => {"models"=>["Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz", "Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz"], "count"=>2, "physicalcount"=>1}
ps => ps -ef
puppet_agent_pid => 29731
puppet_client_datadir => /var/cache/puppet/client_data
puppet_confdir => /etc/puppet
puppet_config => /etc/puppet/puppet.conf
puppet_environmentpath => /etc/puppet/code/environments
puppet_master_server => puppet
puppet_server => puppet
puppet_ssldir => /var/lib/puppet/ssl
puppet_sslpaths => {"privatedir"=>{"path"=>"/var/lib/puppet/ssl/private", "path_exists"=>true}, "privatekeydir"=>{"path"=>"/var/lib/puppet/ssl/private_keys", "path_exists"=>true}, "publickeydir"=>{"path"=>"/var/lib/puppet/ssl/public_keys", "path_exists"=>true}, "certdir"=>{"path"=>"/var/lib/puppet/ssl/certs", "path_exists"=>true}, "requestdir"=>{"path"=>"/var/lib/puppet/ssl/certificate_requests", "path_exists"=>true}, "hostcrl"=>{"path"=>"/var/lib/puppet/ssl/crl.pem", "path_exists"=>true}}
puppet_stringify_facts => false
puppet_vardir => /var/cache/puppet
puppetversion => 4.8.2
root_home => /root
rubyplatform => x86_64-linux-gnu
rubysitedir => /usr/local/lib/site_ruby/2.3.0
rubyversion => 2.3.3
selinux => false
service_provider => systemd
staging_http_get => curl
swapfree => 512.00 MB
swapfree_mb => 512.00
swapsize => 512.00 MB
swapsize_mb => 512.00
system_uptime => {"seconds"=>16239, "hours"=>4, "days"=>0, "uptime"=>"4:30 hours"}
timezone => UTC
uniqueid => 77867b0a
uptime => 4:30 hours
uptime_days => 0
uptime_hours => 4
uptime_seconds => 16239
vcsrepo_svn_ver =>
virtual => xenhvm
Thanks for your Support!
In Ubuntu 16.04, the "check_disk" command from nrpe.cfg fails when run as the "nagios" user.
# sudo -u nagios /usr/lib/nagios/plugins/check_disk -w 20% -c 10% -L -X tmpfs
DISK CRITICAL - /run/lxcfs/controllers/blkio is not accessible: Permission denied
However, this works with -X cgroup
appended.
And thus nrpe fails to install
On a clean puppet installation with this module, I'm greeted with:
"Unknown function params_lookup"
Hi,
It appears I was premature in submitting my solaris support using OpenCSW nrpe package. It seems they just published a new package version which moves the config files from /opt/csw/etc/ to /etc/opt/csw. The new location makes sense, but I have a problem with the puppet module now.
It's quite possible not everyone will update to the new version - I myself am not diligent about keeping csw packages up to date. I stumbled on the problem after pulling another Solaris box into Puppet, only to find that Nagios got ssl handshake errors against it. There were no puppet agent errors, but nrpe was using a default file only allowing localhost to connect. sigh
So, what should I do? Here are my thoughts but I'd like your opinion.
What do you think?
Seems there's a collision for plugins with nagios package from version 1
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate definition: Package[nagios-plugins] is alrea dy defined in file puppet/modules/nrpe/manifests/init.pp at line 452; cannot redefine at puppet/modules/nagios/manifests/plugins.pp:18 on node x
On my CentOS 6 servers there have been the dag repositorys already installed during system build month ago. Now I want to add epel and nrpe modules with puppet.
The EPEL installation with the "before" attribute added works fine.
But when puppet trys to install nrpe from example42/puppet-nrpe module there is an error since nagios-nrpe from dag is newer at version 2.14 and additionally makes nrpe obsolete.
Is there a way to solve this with already given tools or will I have to write a module for dag yumrepos where I exclude nagios-nrpe? This would be a dirty workaround because there could be other repos that have a xxx-nrpe package which makes nrpe obsolete.
Any suggestion here?
-server_address => $::ipadress_eth1, # Listen only on eth1 interface
+server_address => $::ipaddress_eth1, # Listen only on eth1 interface
Hi.
I've tried to add a own plugin but it is still missing after a puppet agent run.
My node configuration:
class { 'nrpe':
allowed_hosts => [ 'MY.NAGIOS.IP.ADDRESS' ],
}
nrpe::plugin { 'check_disk_usage':
source => 'files/nrpe/check_disk_usage.sh'
}
The file will be added correctly to /usr/lib/nagios/plugins. Check on the nagios server:
/usr/lib64/nagios/plugins/check_nrpe -H hostname.of.target.server.com -c check_disk_usage
NRPE: Command 'check_disk_usage' not defined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.