Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
check_sharepoint.pl
1.2
- Nagios 2.x
- Nagios 3.x
- Nagios XI
GPL
110684
File | Description |
---|---|
check_sharepoint.pl | Plugin |
LICENSE.txt | License |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
Similar to check_http but with ntlm support. Will also handle form logons for sites published via ISA/TMG servers.
- Works with both integrated NTML and forms based authentication.
- returns site page load times (with perfmon output).
- warning and/or critical thresholds can be set for site load times.
- semi-informative failure messages (auth failure, insufficient site permissions, 401's, etc)
- ability to check for a specific string on a page
**Note**
- Perl module WWW::Curl::Easy is required.
- libcurl must have ntlm enabled for integrated authentication site checks to work. ('curl-config --features' will show you if you have it)
- This will probably work on Nagios XI but it hasn't been tested yet
Tested with Sharepoint 2007 & 2010
**v1.2 changes**
- added verbose output
- some bug fixes
-------------------------------------------------------------------
check_sharepoint.pl v1.2
Copyright (c) 2012 PCS-IT Services B.V. (www.pcs-it.nl)
Usage: check_sharepoint.pl -H -u -p
-w [warn time] -c [crit time] -t [timeout]
-s [search string] -l [path] -v -form -http
Nagios script for checking of SharePoint web services
Options:
-H Address or hostname of SharePoint site (required)
-u Username (required)
-p Password (required)
-w Warning threshold in seconds
-c Critical threshold in seconds
-t Connection timeout in seconds (default is 60 seconds)
-s Search for custom string on page
-l Specific location or path instead of site root
-v Verbose. HTTP headers in output. 2x (-v -v) includes HTML. 3x both
-form Use forms based authentication (default is ntlm)
-http Connect via standard http (default is https)
Examples:
Check site behind a TMG server using forms based authentication with warning and critital times
check_sharepoint.pl -H portal.hostname.com -u username -p password -form -w 5 -c 10
Check site with integtrated authentication at a specific location within the site
check_sharepoint.pl -H portal.hostname.com -u username -p password -l '/Sites/Wiki%20Pages/default.aspx'
Check site with integtrated authentication that contins the string 'random string'
check_sharepoint.pl -H portal.hostname.com -u username -p password -s 'random string'
Notes:
- If you use special characters in your usernames and/or passwords, authentication will
have a better chance of working if you enclose them in quotes.
- If a URL path is included using the -l option it is must be encoded (e.g. - /Wiki%20Pages/default.aspx)
- Connections are always assumed to be https unless the -http option is used
- Forms authentication is always assumed to be via a ISA/TMG server.
- libcurl must have NTML listed in its features in order for integrated (NTML) authentication
to work. Runing 'curl-config --features' will show if this is present.
- returns site page load times (with perfmon output).
- warning and/or critical thresholds can be set for site load times.
- semi-informative failure messages (auth failure, insufficient site permissions, 401's, etc)
- ability to check for a specific string on a page
**Note**
- Perl module WWW::Curl::Easy is required.
- libcurl must have ntlm enabled for integrated authentication site checks to work. ('curl-config --features' will show you if you have it)
- This will probably work on Nagios XI but it hasn't been tested yet
Tested with Sharepoint 2007 & 2010
**v1.2 changes**
- added verbose output
- some bug fixes
-------------------------------------------------------------------
check_sharepoint.pl v1.2
Copyright (c) 2012 PCS-IT Services B.V. (www.pcs-it.nl)
Usage: check_sharepoint.pl -H
-w [warn time] -c [crit time] -t [timeout]
-s [search string] -l [path] -v -form -http
Nagios script for checking of SharePoint web services
Options:
-H Address or hostname of SharePoint site (required)
-u Username (required)
-p Password (required)
-w Warning threshold in seconds
-c Critical threshold in seconds
-t Connection timeout in seconds (default is 60 seconds)
-s Search for custom string on page
-l Specific location or path instead of site root
-v Verbose. HTTP headers in output. 2x (-v -v) includes HTML. 3x both
-form Use forms based authentication (default is ntlm)
-http Connect via standard http (default is https)
Examples:
Check site behind a TMG server using forms based authentication with warning and critital times
check_sharepoint.pl -H portal.hostname.com -u username -p password -form -w 5 -c 10
Check site with integtrated authentication at a specific location within the site
check_sharepoint.pl -H portal.hostname.com -u username -p password -l '/Sites/Wiki%20Pages/default.aspx'
Check site with integtrated authentication that contins the string 'random string'
check_sharepoint.pl -H portal.hostname.com -u username -p password -s 'random string'
Notes:
- If you use special characters in your usernames and/or passwords, authentication will
have a better chance of working if you enclose them in quotes.
- If a URL path is included using the -l option it is must be encoded (e.g. - /Wiki%20Pages/default.aspx)
- Connections are always assumed to be https unless the -http option is used
- Forms authentication is always assumed to be via a ISA/TMG server.
- libcurl must have NTML listed in its features in order for integrated (NTML) authentication
to work. Runing 'curl-config --features' will show if this is present.
Reviews (9)
byEOSjp, February 1, 2021
Replace the line:
my $curl_features = `curl-config --features`;
With:
my $curl_features = `curl -V`;
my $curl_features = `curl-config --features`;
With:
my $curl_features = `curl -V`;
byhjblik, February 24, 2016
Great script, but NTLM problem caused by perlcurl?
I tried to use this script for another website but got AUTHENTICATION FAILED. Using tcpdump showed Basic Authentication. changing the line
$curl->setopt(CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
into
$curl->setopt(CURLOPT_HTTPAUTH, 8);
solved this problem. It seems that the constant CURLAUTH_NTLM has the value 0 in my case instead of 8. On another system with perl-WWW-Curl-4.15-12.el7.x86_64 instead of perl-WWW-Curl-4.09-4.el6.i686 the value of CURLAUTH_NTLM = 8 so the root casus must be in perl-WWW-Curl-4.09-4.el6.i686
Script works fine now
I tried to use this script for another website but got AUTHENTICATION FAILED. Using tcpdump showed Basic Authentication. changing the line
$curl->setopt(CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
into
$curl->setopt(CURLOPT_HTTPAUTH, 8);
solved this problem. It seems that the constant CURLAUTH_NTLM has the value 0 in my case instead of 8. On another system with perl-WWW-Curl-4.15-12.el7.x86_64 instead of perl-WWW-Curl-4.09-4.el6.i686 the value of CURLAUTH_NTLM = 8 so the root casus must be in perl-WWW-Curl-4.09-4.el6.i686
Script works fine now
byswoma, September 24, 2015
I use it for Sharepoint 2010 and 2013. It is easy to implement and with a small modification you can use it for every ntlm website. The only thing you have to take care is about WWW:Curl::Easy. In RHEL there is a bug that you get 401... Use it from CPAN and it will work as it should.
bysiggi, February 17, 2015
Needs to update for Sharepoint 2013 it seems.. I have everything correct for the setup however getting
CRITICAL: Authentication failed for account
# curl-config --features
SSL
IPv6
libz
NTLM
NTLM_WB
Any ideas? if this should be ok with SharePoint 2013
CRITICAL: Authentication failed for account
# curl-config --features
SSL
IPv6
libz
NTLM
NTLM_WB
Any ideas? if this should be ok with SharePoint 2013
bypvdputte, August 27, 2014
Works fine, only caveat: would not work with libwww-curl-perl 4.12 in Debian Squeeze (kept getting 401 unauthorized). Installing 4.15 from squeeze-backports fixed it.
bytruist, July 30, 2014
This script has a bug where it doesn't do ntlm auth correctly. I was able to fix it by replacing the lines that set CURLOPT_USERNAME and CURLOPT_PASSWORD with:
$curl->setopt(CURLOPT_USERPWD,$username . ':' . $password);
$curl->setopt(CURLOPT_USERPWD,$username . ':' . $password);
byjamesdeb, May 14, 2014
I have also the 401 Unauthorized error when I run the check.
It use curl and WWW::Curl::easy .
When I run the curl command , I have first a 401 error , then I have the HTTP/1.1 200 Ok message , so the connection looks ok but the check_sharepoint.pl check take only the 401 as result.
If someone can help thanks,
It use curl and WWW::Curl::easy .
When I run the curl command , I have first a 401 error , then I have the HTTP/1.1 200 Ok message , so the connection looks ok but the check_sharepoint.pl check take only the 401 as result.
If someone can help thanks,
bymmcleod, April 23, 2013
Script looks great, just what I'm looking for but it always returns a 401 Unauthorized error...
Definitely correct credentials and infact a very basic NTLM script here check_http_ntlm.pl works perfectly but lacks any performance data.
Would appreciate any help...!
Definitely correct credentials and infact a very basic NTLM script here check_http_ntlm.pl works perfectly but lacks any performance data.
Would appreciate any help...!
bydceola, November 13, 2012
This plugin works very well. I'm currently using it to monitor all of my SharePoint site collections as well as our MS CRM site. It works great for any page that requires NTLM authentication.
I've actually been wondering if there is a way to 'convert' this script to a windows friendly exe, in order to run it from a few client side systems through nsclient++. I've tried a few things myself but it kept coming back to not being able to get CURL installed on windows...
I've actually been wondering if there is a way to 'convert' this script to a windows friendly exe, in order to run it from a few client side systems through nsclient++. I've tried a few things myself but it kept coming back to not being able to get CURL installed on windows...