Hot answers tagged

18

Turns out that the number of pending regular updates can be found using: /usr/lib/update-notifier/apt-check 2>&1 | cut -d ';' -f 1 And the number of pending security updates can be found using: /usr/lib/update-notifier/apt-check 2>&1 | cut -d ';' -f 2 In the end, my Nagios plugin was as follows: #!/bin/sh # Standard Nagios plugin return ...


9

You can find the answer here: http://ubuntuforums.org/showthread.php?t=1328967 Here's the copy-paste from the above link: on commit { set ClientIP = binary-to-ascii(10, 8, ".", leased-address); set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)); log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac)); ...


7

The Nagios plugin /usr/lib/nagios/plugins/check_apt does not detect critical updates in Ubuntu correctly due how it detects critical updates via apt combined with how Ubuntu non-critical updates are published. More details are in the bug here: https://bugs.launchpad.net/bugs/1031680 Using /usr/lib/update-notifier/apt-check instead is a reliable workaround.


6

The Nagios docs explain this setting as: This directive determines whether or not checks for the service will be "obsessed" over using the ocsp_command. The ocsp_command is explained here. This is the "Obsessive Compulsive Service Processor Command." This option allows you to specify a command to be run after every service check, which can be ...


5

OK, I've been trawling though the Nagios3 documentation and have answered the port configuration part of my question... The answer lies in the Object Inheritance model that exists within the Nagios configuration files. Essentially I created a custom variable in each host definition that specifies the unique ssh port on that machine: define host { use ...


2

I've know about two options, but I haven't tried them: Nagios installer for Windows (only 32 bit installer) Nagwin You might want to take a look here, this site is dedicated for all kinds of extensions for Nagios. Have fun.


2

SUGGESTION #1 I have a suggestion if you are willing to get your hands a little dirty and the tables are reasonably small enough. You should convert all tables with auto_increment from INT to BIGINT. This should suppress autoincrement overflow issues for our lifetime. This will result in bigger tables (1 extra byte per row). SUGGESTION #2 If you still ...


2

Install the package libnagios-object-perl as well as package librrds-perl. This is assuming you are running Debian.


2

I would recommend using the "negate" plugin that is included in the newest packages of monitoring plugins. The man page for the plugin is: https://www.monitoring-plugins.org/doc/man/negate.html Then create a customer command and custom host such as: define command{ command_name check-host-dead command_line /usr/local/libexec/negate ...


2

Update: There's now an official blackbox exporter https://github.com/prometheus/blackbox_exporter There's an blackbox prober for Prometheus that'll let you do this: https://github.com/discordianfish/blackbox_prober Prometheus is mainly focused on whitebox rather than blackbox monitoring, but over time it's likely this functionality will be added as a core ...


1

Connect as a regular user, not root. If the command ping localhost says something along the lines of ping: icmp open socket: Operation not permitted then check out Ping: icmp open socket: Operation not permitted (Linux) It basically states that you need to add the "s" flag on the ping binary, usually located on /bin/ping on Debian systems: sudo chmod u+s ...


1

I found the solution and separated it in five steps, so you could install it in a Virtual machine and don't have to upgrade or install the package every time, so you can run just the last step that you run before. 1. Adding the repository #!/bin/bash if [ ! -f rpmforge-release-0.5.3-1.el6.rf.i686.rpm ]; then #i386 wget ...


1

You will have to install wget is you don't have it already: #!/bin/bash IFS=' ' LIST='http://www.google.com http://www.drk.com.ar/daphne.php http://www.google.com/this-is-an-error http://serverfault.com/questions ' for I in $LIST do wget -q --no-cache --spider $I if [ $? != 0 ]; then echo Error: $I fi done


1

Not sure how this could happened, but you should be able to recover by modifying your map configuration file. You should have a file like /usr/local/nagvis-x.x/etc/maps/map-01.cfg Edit this file and you should find something like this in the global section definition : define global { grid_show=0 iconset=std_medium text=MYTEXT } Remove text=MYTEXT from ...


1

You can use this as a starting point, and adapt to your liking: #!/bin/bash logfile="/var/log/file.log" while read line; do value=`echo $line | awk -F: '{print $4}' | awk -F'(' '{print $1}' | sed 's/^.//'` if [ "`echo $value | grep -o ".$"`" == "M" ]; then value=`echo $value | awk -F'.' '{print $1}'` value=$((value/1000)) elif [ ...


1

If you already have a working check but it does the exact opposite of what you want, have you tried changing the exit values around so that it doesn't alert for "failure" and does alert for "success"? In your scenario, exit 0 would be for the failure and exit 1 or exit 2 would be for success. If you are confused about what I am referring to by exit values, ...



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