Hot answers tagged

6

Nagios::Plugins was renamed to Monitoring::Plugins due to trademark reason. cpan doesn't index Nagios::Plugins anymore. Now you must install Monitoring::Plugin perl -MCPAN -e 'install Monitoring::Plugin' Or you can install it via cpanm. First install cpanm: curl -L http://cpanmin.us | perl - --sudo App::cpanminus and then install the module cpanm ...


4

Error: System call sent warnings to stderr: error: unsupported option (BSD syntax) The problem is that there's a mis-match between the check_procs plug-in and your operating system's ps command. Nagios' check_procs plug-in spawns the ps command to check processes, applying a scanf()-style format string to the command's output to find out what it needs to ...


4

It is complaining that there is only 10% free space left, which is not good. It is saying 99% of the inodes are free.


4

I have followed the problem, as in: $ /usr/lib/nagios/plugins/check_memory MEMORY CRITICAL - Unable to interpret /usr/bin/free output What I found is the output of the free command in procps changed the output format. $free -m old format: total used free shared buffers cached Mem: 3011 1415 1596 ...


4

You appear to be running an ssh server on your http/https ports: nc -vvv 46.101.145.158 80 Connection to 46.101.145.158 80 port [tcp/http] succeeded! SSH-2.0-dropbear_2016.72 nc -vvv 46.101.145.158 443 Connection to 46.101.145.158 443 port [tcp/http] succeeded! SSH-2.0-dropbear_2016.72 If you're trying to run ssh and http/https on the same port I would ...


3

eth0:1 is a virtual interface off of eth0. The mac address of a virtual IP is always the same as the mac that it is based off of, here eth0. So as suggested in the comments by Mark Plotnick, if you want to have another interface (on a virtual machine) don't put a colon in the name, but use another number, e.g. eth2. Don't get confused: a virtual IP is not ...


3

The user that Nagios runs as requires sudo rights just like with your normal account. You can use a command like this to see what sudo right a user has: $ su - nagios -c "sudo -l" Matching Defaults entries for nagios on this host: requiretty, !visiblepw, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR ...


3

NRPE hasn't been updated in a few years (September 2013), this is what it does on the server side SSL_library_init(); SSLeay_add_ssl_algorithms(); meth=SSLv23_server_method(); ... SSL_CTX_set_options(ctx,SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); ... SL_CTX_set_cipher_list(ctx,"ADH"); dh=get_dh512(); and the client (check_nrpe on Nagios server) SSL_library_init(...


3

To finish installing nagios-nrpe-server, I ended up verifying the post-install scripts. At nagios-nrpe-server.postinst: #!/bin/sh set -e # Automatically added by dh_installinit if [ -x "/etc/init.d/nagios-nrpe-server" ]; then update-rc.d nagios-nrpe-server defaults >/dev/null invoke-rc.d nagios-nrpe-server start || exit $? fi # End automatically ...


3

Use an XML parser like XMLStarlet: $ xml sel -t -v '//host' -v '//name' file.xml This would extract the contents of any <host> or <name> node anywhere in the file.xml XML document. XMLStarlet is likely available through your ordinary package manager. The executable is sometimes called xmlstarlet rather than just xml.


3

Using arrays in bash can make your code much easier to read and to maintain. #!/bin/bash libexec="/usr/local/nagios/libexec" # for command line arguments: hostnames=("$@") # or to hardcode them: hostnames=(hostname1 hostname2 hostname3 hostname4 hostname5 hostname6) nagios_ok=0 nagios_warning=1 nagios_critical=2 nagios_unknown=3 curl_opts=( --...


3

No, iptables is managed by the kernel; there is no corresponding process, so no process identifier.


3

try this, perl -0777 -ne '/([^\n]*{[^}]*(yyyyyyyyy991)[^}]*})/ && print "$1\n"' file Explanation: perl -0777 Run perl and slurp the whole file as one line. -ne for each line (n), execute (e) the following. /(pattern)/ && print "$1\n" match a regex pattern and add it as first matching group ($1), then print it. The Pattern: [^\n]*{ ... } ...


2

The problem The error is actually pretty self explanatory. Error: Could not find any hostgroup matching 'allhosts' You have this line in your define host{...} block: hostgroups allhosts ; Host groups this printer is associated with Solution You need to create a hostgroup called allhosts. In the file /etc/nagios/hostgroups.cfg, most ...


2

The problem is likely that Nagios is never killed/restarted so that it starts logging to a new log file. Here are a couple examples that show how you'd go about doing the postrotate action. /var/log/nagios/nagios.log { daily rotate 180 compress dateext missingok notifempty sharedscripts postrotate /sbin/service nagios reload > /dev/null 2>/dev/...


2

If you are using vhost internaly it is always better solution to make vhost configuration with different ports, so in this case you can setup nagios domain on 8083 port: first step: In httpd.conf you need to spicify listening ports: Listen 8080 Listen 80 Listen 8083 In httpd-vhosts.conf add a NameVirtualHost for every virtual host you want to add. ...


2

Maybe it would be a good idea to replace: # -------- get dataset of filesystem DATASET=`df -h $1 | grep -v Filesystem | awk '{print $1}'` with the following: # -------- get dataset of filesystem DATASET=`df -h $1 | awk '{print $1}' | tail -n 1` Because of localization issues on some installations, some distros think it's a good idea to replace such ...


2

I managed to solved the problem by first creating the file manually. Here is what I did: my apache2 files are in /usr/local/apache2/ . So I created a directory mkdir passwd in /apache2/ directory and created a file in that passwd directory by running touch passwords. Then I finally ran htpasswd -c /usrl/local/apache2/passwd/passwords flicker . Please note ...


2

That you did not receive notifications is because all the reported states are SOFT. Notifications are only sent out for HARD states. You need to look into the service configuration and check the value of max_check_attempts for your service.


2

Reading around it seems that RPM package manager is unable to track dependencies YUM adds automatic updates and dependency management for this I would prefer to use yum whenever is possible. I don't know exactly the problem in your case, but I would try to fix it using one of the following two approaches : Install rpm and resolve dependencies with ...


2

We have the plugins directory in the monitored host (CLIENT), because you installed the nagios plugins. Nagios monitoring host executes the check_nrpe plugin specified for example as the following command: $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk $HOSTADDRESS$ is the IP address of your CLIENT machine (monitored host). On the monitored host the ...


2

SSL/TLS can support sessions that do not require X.509 certificates, such as anonymous Diffie Hellman, but it's very unlikely that you'll come across real world implementations that use it - for a start there is no authentication with this cipher suite. There is documentation here that describes the process needed to configure TLS in Nagios. The ...


2

If you want to install it using rpm, download the package here and install it : rpm -Uvh nagios-3.5.1-1.el6.x86_64.rpm Try and see if the older version of nagios is still available (Double check just to be sure. You don't wanna jump through hoops for no reason) yum --showduplicates list nagios | expand If the older version does not exist : Disable the ...


2

If your grep supports it, you can use the -z option to make it slurp the entire file: $ grep -ozE 'define[^}]*host_name yyyyyyyyy991.+?}.' file define host{ host_name yyyyyyyyy991 use aix-server alias hostgroups +bu-automotiveprd,screen-automotiveprd2 address YYY.YYY.YYY.YYY } The grep options used are (from the man ...


2

You can configure ssh-keygen where your plugin can login to the remote server automatically without a password by sshpass in which we can pass the password in the command line itself sshpass -p "password" ssh hostname "df -Ph | sed -n '/\/$/p'| sed "s/%//g""|awk '{print $(NF-1)}'


1

You can use pgrep. See man pgrep $pgrep nagios #list all the process ids for counting: $pgrep nagios | wc -l


1

The problem was that lsof in that script was being run as the nagios user. Adding the following line to /etc/sudoers (or optionally to a new file in /etc/sudoers.d/ ) was necessary: nagios ALL=(root) NOPASSWD: /usr/bin/lsof Additionally, it was necessary to amend line 15 of the script to contain this: proc1_lsof = "sudo lsof -p " + ','.join(map(str,...


1

Your code already seems correct, -mmin -10 narrows results to "modified less than 10 minutes ago". If your videos/ also has other items such as subdirectories, you might be able to shave some time time by ignoring directories and focusing only on files, adding -type f: find /srv/unifi-video/videos/ -type f -name '*.ts' -mmin -10 | wc -l If you have any ...


1

The code in check_smtp_send is buggy. It either directly specifies an invalid string for SSL_version or uses a module which does so (the very old and unmaintained module Net::SMTP::TLS is known for this bug). It might be that it is fixed in newer versions of the code. But given that I have no idea which OS you are running, which package this code belongs ...


Only top voted, non community-wiki answers of a minimum length are eligible