Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Directory

giner

Reviews(6)
byginer, December 29, 2014
3 of 3 people found this review helpful
Here is a work around for everyone who can't make check_vmware_api work on recent OS with new perl and recent VMware Perl SDK.


Prerequisites:
- Ubuntu 14.04 Server (perl v5.18.2)
- VMware-vSphere-Perl-SDK-5.5.0-2043780
- check_vmware_api.pl 0.7.1


Basic installation:

apt-get install perl-doc libssl-dev libxml-libxml-perl libarchive-zip-perl libcrypt-ssleay-perl libclass-methodmaker-perl libuuid-perl libdata-dump-perl libsoap-lite-perl libio-compress-perl
tar -xf VMware-vSphere-Perl-SDK-5.5.0-2043780.x86_64.tar.gz -C /tmp
cd /tmp/vmware-vsphere-cli-distrib
./vmware-install.pl



Work around for "Server version unavailable":

patch -b /usr/share/perl/5.18/VMware/VICommon.pm new(agent => "VI Perl");
+ $user_agent->ssl_opts( SSL_verify_mode => 0 );
my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1);
$user_agent->cookie_jar($cookie_jar);
$user_agent->protocols_allowed(['http', 'https']);
@@ -502,7 +503,7 @@
sub query_server_version {
BEGIN {
#To remove SSL Warning, switching from IO::Socket::SSL to Net::SSL
- $ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
+ #$ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS} = "Net::SSL";
#To remove host verification
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
}
@@ -526,6 +527,7 @@
}
}
my $user_agent = LWP::UserAgent->new(agent => "VI Perl");
+ $user_agent->ssl_opts( SSL_verify_mode => 0 );
my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1);
$user_agent->cookie_jar($cookie_jar);
$user_agent->protocols_allowed(['http', 'https']);
@@ -2108,6 +2110,7 @@
sub new {
my ($class, $url) = @_;
my $user_agent = LWP::UserAgent->new(agent => "VI Perl");
+ $user_agent->ssl_opts( SSL_verify_mode => 0 );
my $cookie_jar = HTTP::Cookies->new(ignore_discard => 1);
$user_agent->cookie_jar( $cookie_jar );
$user_agent->protocols_allowed( ['http', 'https'] );
*****************************************************************
byginer, November 14, 2014
1 of 1 people found this review helpful
Thanks for the plugin, this is the best one!

Here are two remarks:
1. It doesn't work for Windows and ESXi as they don't provide zone information by SNMP.
2. Timeout should be changed from 60 seconds and 5 retries to 30 second and single retry in order not to get CRITICAL instead of WARNING:

--- snmp_remote_time_utc.orig 2014-11-14 11:56:09.000000000 +0100
+++ snmp_remote_time_utc 2014-11-14 15:01:55.360771200 +0100
@@ -53,7 +53,7 @@

getandprintresults() {
# Get local and remote time at the same time, so we can do a diff later. Local in utc.
- rdatestring=$( snmpget -v $version -t 60 -c $community $host HOST-RESOURCES-MIB::hrSystemDate.0 2> /dev/null | gawk '{print $NF}' )
+ rdatestring=$( snmpget -v $version -t 30 -r 1 -c $community $host HOST-RESOURCES-MIB::hrSystemDate.0 2> /dev/null | gawk '{print $NF}' )
ldate=$(date -u)

[ ! "$rdatestring" ] && exit_unknown
byginer, September 4, 2014
check_esxi_hardware.py
Adding nagios user to the root group is a big security hole. I suggest never doing this.

Here is a better work around until VMware fixes 'CIM interaction' permission (which doesn't work at least since 4.0 and up to the recent 5.5):

1) Create a local user 'nagios' on a ESXi host
2) Add a cron job to check and update /etc/security/access.conf
user=nagios; access=/etc/security/access.conf; crontab=/var/spool/cron/crontabs/root; grep $access $crontab > /dev/null || cat $crontab
*/5 * * * * grep '^+:$user:sfcb$' $access > /dev/null || sed -i '2i +:$user:sfcb' $access
EOF
3) Done!

Now you can use nagios user to check check_esxi_hardware.py, no special roles or permissions are needed.
byginer, April 24, 2014
Here is an update made by Alexander Tikhomirov:
1) add performance data
2) cosmetic changes

http://pastebin.com/MFBeNkiK
byginer, March 2, 2014
--- /tmp/check_drbd.orig 2014-03-03 01:35:53.000000000 +0400
+++ check_drbd 2014-03-03 08:54:59.897998487 +0400
@@ -12,7 +12,7 @@
my $drbd_proc='/proc/drbd';
my $drbd_devices=0;
my ($drbd_expect, $drbd_role, $drbd_version, $debug_mode);
-my (%options, %cs, %st, %ld, %ds, %check, %warning, %critical);
+my (%options, %cs, %st, %ld, %ds, %oos, %check, %warning, %critical);

my $prog_name=basename($0);
my $prog_revision='0.5.3';
@@ -210,10 +210,17 @@
} else {
$input = "STDIN";
}
+ my $devnum;
while() {
if (/^version: (\d+).(\d+)/) {
$drbd_version = "$1.$2";
}
+ if (/^\s?(\d+):.*/) {
+ $devnum = $1;
+ }
+ if (defined($devnum) and /\soos:(\d+)/) {
+ $oos{$devnum} = $1;
+ }
if (/^\s?(\d+):.* cs:(\w+)/) {
$cs{$1} = $2;
}
@@ -248,11 +255,11 @@
#
my @devices;
if ($drbd_devices =~ /^all$/i) {
- for my $device ( keys %cs ) {
+ for my $device ( sort keys %cs ) {
push(@devices,$device);
}
} elsif ($drbd_devices =~ /^configured$/i) {
- for my $device ( keys %cs ) {
+ for my $device ( sort keys %cs ) {
next if ($cs{$device} eq "Unconfigured");
push(@devices,$device);
}
@@ -264,6 +271,9 @@
&myexit('UNKNOWN',"Could not find device $device");
}
$check{$device} = 1;
+ if (defined($oos{$device}) and $oos{$device} > 0) {
+ &myexit('WARNING',"Out of sync on device $device: $oos{$device} sectors");
+ }
}
if (int(keys %check) == 0) {
&myexit('UNKNOWN',"No configured devices found");
byginer, March 18, 2013
1 of 1 people found this review helpful
check_emc_clariion.pl maintained by BuddhaBob74
Great plugin!
I have fixed a couple of bugs.

1. No more duplicates when check one port (with a --port option) and not all of them.
2. Now is able to check several ports at one time. Syntax example: poststate --SP A --port 1,3.


--- check_emc_clariion.pl.orig 2013-03-09 14:54:48.000000000 +0100
+++ check_emc_clariion.pl 2013-03-19 08:25:43.000000000 +0100
@@ -1103,7 +1103,7 @@
$sp_line = 1;
}
# check for requested port id
- if ($opt_port >=0) {
+ if ($opt_port =~ /^d+$/) {
if( $_ =~ m/^SPsPortsID:s+($opt_port)$/) {
$port_id = $1;
$portstate_line = 1;
@@ -1165,14 +1165,11 @@
$output .= "Connection Type: $type. ";
}
# end of section
- if ( $_ =~ m/^s*$/) {
- $portstate_line = 0;
- ### $sp_section = 0;
- if ($opt_port >=0 ) {
- $sp_section = 0;
- }
- $sp_line = 0;
- }
+ }
+ if ( $_ =~ m/^s*$/) {
+ $portstate_line = 0;
+ $sp_section = 0;
+ $sp_line = 0;
}
}
close (NAVICLIOUT);
Owner's reply

This has been included in version 2014-05-06. Cheers