Page 1 of 1

check_sharepoint.pl

Posted: Wed May 18, 2016 8:33 am
by emartine
https://exchange.nagios.org/directory/P ... pl/details

I was looking at the above plugin as I am in need of a check for a sharepoint server that uses NTLM and can do a search for a string search on a page and can also inform on load times.
The reason for this is that we have some folks that reported a sharepoint 2013 site was down... nagios detected that the port was open (tcp check) but when authenticating the page was blank.

I've read on the forums that some folks have had issues trying to get this to work but no resolve on them not sure if they were able to or not and I am also not familiar with trying to get the perl module WWW::Curl::Easy installed.

Is this a good plugin to start with to see if this works or is there an alternative I should be looking at? If this is the plugin to use I would appreciate some help getting the perl module installed. Any help would be greatly appreciated.

Re: check_sharepoint.pl

Posted: Wed May 18, 2016 1:20 pm
by hsmith
We don't run sharepoint here, so I'm unable to test, however..

Try installing the module like this:

Code: Select all

perl -MCPAN -e shell
Inside that shell, try this command:

Code: Select all

  i /WWW-Curl/
Let me know if this works.

Re: check_sharepoint.pl

Posted: Wed May 18, 2016 3:56 pm
by emartine
[~]# perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.9402)
Enter 'h' for help.

cpan[1]> i /WWW-Curl/
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Wed, 18 May 2016 20:17:02 GMT
Distribution ANDREMAR/WWW-Curl-Simple-0.100191.tar.gz
Distribution DFARRELL/WWW-curlmyip-0.04.tar.gz
Distribution JHK/WWW-Curl-UserAgent-0.9.6.tar.gz
Distribution OAXLIN/WWW-Curl-TraceAscii-0.05.tar.gz
Distribution SZBALINT/WWW-Curl-4.17.tar.gz
5 items found

Re: check_sharepoint.pl

Posted: Wed May 18, 2016 4:20 pm
by hsmith
Try these steps:

Code: Select all

yum -y install libcurl libcurl-devel
perl -MCPAN -e shell
install WWW::Curl::Easy
Let me know if that works better.

Re: check_sharepoint.pl

Posted: Wed May 18, 2016 4:36 pm
by emartine
Awesome. That worked! Thank you!

Re: check_sharepoint.pl

Posted: Wed May 18, 2016 4:38 pm
by hsmith
Great :), does that mean the plugin is working?

Re: check_sharepoint.pl

Posted: Fri May 20, 2016 10:50 am
by emartine
I'm running this....
./check_sharepoint.pl -H server.sharepoint.com/sites/pe/SitePages/Home.aspx -s <some string> -u <someuser> -p <somepassword> -w 4 -c 5 -t 20
OK: 'https://server.sharepoint.com/sites/pe/ ... /Home.aspx' polled in 2.01091 seconds|'Response Time'=2.01091s;;;0


Seems like the string search isn't working.

Re: check_sharepoint.pl

Posted: Fri May 20, 2016 11:08 am
by rkennedy
Can you show us what your <some string> part actually is? If there are any special characters, it could be not parsing properly.

Re: check_sharepoint.pl

Posted: Tue May 31, 2016 9:42 am
by emartine
The command above works. Tested this on 3 servers without issue.
On a fourth server not sure why I am getting this error when attempting to install via cpan


Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/*.t
t/00constants.t ........... ok
t/01basic.t ............... ok
t/02callbacks.t ........... ok
t/04abort-test.t .......... ok
t/05progress.t ............ ok
t/06http-post.t ........... skipped: Not performing http POST/upload tests
t/07ftp-upload.t .......... skipped: Not performing ftp upload tests
t/08ssl.t ................. 11/19
# Failed test 'https://www.verisign.com/ ssl test succeeds'
# at t/08ssl.t line 86.
t/08ssl.t ................. 12/19
# Failed test 'https://www.verisign.com/ ssl test succeeds'
# at t/08ssl.t line 86.
t/08ssl.t ................. 13/19
# Failed test 'https://www.verisign.com/ ssl test succeeds'
# at t/08ssl.t line 86.
t/08ssl.t ................. 16/19 # Looks like you failed 3 tests of 19.
t/08ssl.t ................. Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/19 subtests
t/09times.t ............... ok
t/10errbuf.t .............. ok
t/13slowleak.t ............ skipped: Not performing slow leakage regression test
t/14duphandle.t ........... ok
t/15duphandle-callback.t .. ok
t/16formpost.t ............ skipped: Not performing POST
t/17slist.t ............... skipped: Not performing printenv cgi tests
t/18twinhandles.t ......... ok
t/19multi.t ............... ok
t/20undefined_subs.t ...... ok
t/21write-to-scalar.t ..... ok
t/meta.t .................. skipped: Test::CPAN::Meta required for testing META.yml
t/pod-coverage.t .......... skipped: Test::Pod::Coverage 1.04 required for testing POD coverage
t/pod.t ................... skipped: Test::Pod 1.14 required for testing POD

Test Summary Report
-------------------
t/08ssl.t (Wstat: 768 Tests: 19 Failed: 3)
Failed tests: 11-13
Non-zero exit status: 3
Files=22, Tests=732, 46 wallclock secs ( 0.16 usr 0.04 sys + 0.93 cusr 0.20 csys = 1.33 CPU)
Result: FAIL
Failed 1/22 test programs. 3/732 subtests failed.
make: *** [test_dynamic] Error 255
SZBALINT/WWW-Curl-4.17.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports SZBALINT/WWW-Curl-4.17.tar.gz
Warning (usually harmless): 'YAML' not installed, will not store persistent state
Running make install
make test had returned bad status, won't install without force
Failed during this command:
SZBALINT/WWW-Curl-4.17.tar.gz : make_test NO

Re: check_sharepoint.pl

Posted: Tue May 31, 2016 12:47 pm
by rkennedy
Can you also run the make test on a working server, and post the result?