Commit graph

32 commits

Author SHA1 Message Date
Sven Nierlein
3b962208e7 fix timeout issue with check_disk_smb
check_disk_smb hangs if the smbclient is still running. So send a sigint to all
childs and exit cleanly.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
d6baf9dbce change exit code to unknown on help and version info
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2015-10-04 19:24:30 +02:00
Elan Ruusamäe
8079ead7fa drop superfluous libexecdir
utils.pm locate is already convered by FindBin
2015-10-02 13:58:43 +02:00
Holger Weiss
1f4fd12845 Don't rely on FindBin module to locate utils.pm
As the FindBin module doesn't work with ePN, set the path to utils.pm
explicitly at build time.  Keep using FindBin additionally, so that the
plugins can also be executed from the build directory.

Closes #1271.
2014-07-06 19:55:03 +02:00
Holger Weiss
c08d6a429b Replace "plugins-scripts/subst.in" foo
Remove the buggy and complex awk(1) magic in "plugins-scripts/subst.in"
in favor of simple sed(1) substitutions.

The plugins in the "plugins-scripts" directory now always use the PATH
specified via "./configure --trusted-path", or the default PATH
hard-coded in "configure.ac".

Fixes #1242.
2014-02-28 13:28:33 +01:00
Holger Weiss
e260efb256 Merge remote-tracking branch 'awiddersheim/fix_trusted_path'
* awiddersheim/fix_trusted_path:
  Fix trusted path

Conflicts:
	plugins-scripts/check_ntp.pl
	plugins-scripts/subst.in

Closes #1212.
2014-02-28 13:22:34 +01:00
Evgeni Golov
9408c975fe utils.pm: use FindBin instead of awk to find the path to
'use lib utils.pm' is not valid Perl syntax:
 Bareword "utils" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.
 Bareword "pm" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.

This makes it impossible to use the plugins directly from the git tree,
e.g. while hacking on them.

Using FindBin::Bin as the library path allows that, while preserving
the original behaviour of adding the libexec path when the plugin is
properly installed.
2014-02-27 20:56:50 +01:00
Monitoring Plugins Development Team
63734f52ab Project rename initial commit.
This is an initial take at renaming the project to Monitoring Plugins.
It's not expected to be fully complete, and it is expected to break
things (The perl module for instance). More testing will be required
before this goes mainline.
2014-01-19 14:18:47 -05:00
awiddersheim
0a3252d88d Fix trusted path
When configuring the plugins you have the option to specify a trusted path with --with-trusted-path. This option seems to have been deprecated at some point for unknown reasons and had typically had no affect. This commit makes this option work again for those who have a desire to use it. There should be no affect on those who have not chosen to specify a trusted path.
2013-10-22 10:33:56 -04:00
Sven Nierlein
63312395ee check_disk_smb: verify path to smbclient 2013-09-16 13:59:27 +02:00
Rafael
febe7b7075 Changed the smbclient command used to fetch the free space available on the samba shares. Using du instead of ls, since it's much faster, specially with shares that have a lot of files. 2013-08-12 15:52:22 -03:00
Holger Weiss
d61a3056c5 check_disk_smb: Add performance data
(Debian #654259 - Charles-Henri Larose)
2012-06-23 10:22:08 +02:00
Matthias Eble
3c67c9cb60 check_disk_smb now handles NT_STATUS_ACCESS_DENIED properly (Debian #601696) 2010-11-28 21:43:48 +01:00
Matthias Eble
0892c4ac28 Make check_disk_smb accept spaces in share names (#990948, #1370031, Debian #601699) 2010-11-28 21:35:59 +01:00
Holger Weiss
614e9dec5e Fix Debian bug #478942: Fragile argument passing
Fix some problems regarding the way check_disk_smb passes command line
arguments to smbclient(1).

| It runs:
|
| 	$res = qx/$smbclient "\/\/$host\/$share" $pass -W $workgroup \
| 	       -U $user $smbclientoptions -I $address -c ls/;
|
| [...]
|
| The documentation says that if the password is not passed, it
| defaults to "".  That is not true above, as $pass expands to
| nothing which leaves no argument at all (instead of an empty
| argument) so is different from providing with an empty password
| or with the -N option.
|
| Also, if the password starts with "-", you're in trouble, that's
| why -U $user%$pass may be prefered.
|
| Also, the doc says that if $user is not provided, then it
| defaults to "guest" but the problem is that if it is provided
| but empty, it is changed to "guest" as well, which prevents us
| from querying hosts that don't do user authentication.

[ http://bugs.debian.org/478942 ]

(Fixed by Stephane Chazelas, forwarded by Jan Wagner.)
2010-04-11 10:54:44 +02:00
Holger Weiss
de7191e342 Fix Debian bug #478906: Failure when run via ePN
| When perl plugin scripts are run with the embedded perl interpreter in
| nagios3, the "shift" perl command doesn't shift @ARGV, but @_ (which
| happens to contain the same thing as @ARGV at the time the script was
| started).
|
| [...]
|
| A fix is to replace all the instances of "shift" with "shift @ARGV".

[ http://bugs.debian.org/478906 ]

(Fixed by Stephane Chazelas, forwarded by Jan Wagner.)
2010-04-11 09:54:10 +02:00
Holger Weiss
e461341003 Fix Debian bug #425129: SMB guest mode won't work
| The check_disk_smb plugin purports to support guest users, but it
| doesn't work out, because it doesn't specify the -N command line
| option to smbclient when no password is specified, making smbclient
| stop and ask.

[ http://bugs.debian.org/425129 ]

(Fixed by Josip Rodin, forwarded by Jan Wagner.)
2010-04-11 09:39:24 +02:00
Holger Weiss
5a1babdae8 check_disk_smb: Allow for specifying an IP address
Add the "-a, --address option" which allows for specifying the IP
address of the server to connect to.  If this option is used, the IP
address will be handed over to smbclient(1)'s "-I" option.  (Contributed
by Sean Finney, forwarded by Jan Wagner.)
2010-04-11 01:57:11 +02:00
Thomas Guyot-Sionnest
6fbd14fea5 Removing CVS/SVN tags and replacing with git-based versioning
For contrib/, full tags have been imported from subversion


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-23 05:38:47 +00:00
M. Sean Finney
a0a6dd410c debian bts #300701:
- check_smb fix for freespace threshold parsing from the cmdline options.


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1247 f882894a-f735-0410-b71e-b25c423dba1c
2005-10-13 10:14:33 +00:00
M. Sean Finney
ea75bd95d3 also change the --help output to reflect that check_disk_smb defaults to empty passwords
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1164 f882894a-f735-0410-b71e-b25c423dba1c
2005-04-17 22:22:41 +00:00
M. Sean Finney
cf35fb4b92 patch to check_disk_smb to allow empty passwords
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1163 f882894a-f735-0410-b71e-b25c423dba1c
2005-04-16 06:09:47 +00:00
Ton Voon
b7591825d4 Optionally specify port for smbclient to use (781227 - Jason Burnett)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@723 f882894a-f735-0410-b71e-b25c423dba1c
2003-09-15 14:26:54 +00:00
Ton Voon
b25150f0a4 Update error message from smbclient v2.2.7 (Patch 740132 - Cove Schneider)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@580 f882894a-f735-0410-b71e-b25c423dba1c
2003-07-02 15:57:29 +00:00
Karl DeBisschop
82d729563f option regexs need to include ^ and $
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@348 f882894a-f735-0410-b71e-b25c423dba1c
2003-02-20 03:16:26 +00:00
Karl DeBisschop
2350599a4c accept $ for share and \\ for users
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@241 f882894a-f735-0410-b71e-b25c423dba1c
2003-01-16 05:19:09 +00:00
Karl DeBisschop
a7fed9440f remove pspace in shebang since no sequent users replied
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@162 f882894a-f735-0410-b71e-b25c423dba1c
2002-10-28 13:05:08 +00:00
Subhendu Ghosh
9be0af942a patch for admin shares
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@80 f882894a-f735-0410-b71e-b25c423dba1c
2002-08-14 19:17:13 +00:00
Subhendu Ghosh
bdb73692bf logic fix for disk space thresholds
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@56 f882894a-f735-0410-b71e-b25c423dba1c
2002-06-20 04:27:38 +00:00
Subhendu Ghosh
12503c81fa ePN fix and support for utils.pm
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@34 f882894a-f735-0410-b71e-b25c423dba1c
2002-05-27 01:55:41 +00:00
Subhendu Ghosh
becc0f34e6 fix for embedded perl
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@21 f882894a-f735-0410-b71e-b25c423dba1c
2002-05-02 16:43:29 +00:00
Ethan Galstad
44a321cb8a Initial revision
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2 f882894a-f735-0410-b71e-b25c423dba1c
2002-02-28 06:42:51 +00:00