Hi Daniel,

You're running into an issue that someone else saw very recently, and has 
suggested a work-around for.  Disclaimer that I haven't had a chance to verify 
this.  But it looks reasonable, so I"ll pass it along.  If you are still not 
succeeding with this in place, then we'll dig in further.

Replace lines 666 - 679 with the following:

# split the return into 3 based on blank line(401 header, interesting
header, body)
my @temp = (split(/^\s*$/m, $returnfromCurl, 3));

# this is the interesting header (and we skip over the earlier 401 header)
$returnfromCurl= @temp[1];

if ( $returnfromCurl =~ m/HTTP\/1.1 200/ ) {
if ( $returnfromCurl =~ m/Content-Length: 0/ ) {
$message = ("Management-API: returned: Content-Length: 0 -
$curl_command ");
}

# all is well so we now move the body of the return to the variable
$returnfromCurl = @temp[2];
$returnfromCurl =~ s/^\s+//;
}

--Colleen

________________________________
From: [email protected] 
[[email protected]] on behalf of Gibbons, Daniel (RBI-UK) 
[[email protected]]
Sent: Wednesday, July 10, 2013 12:40 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working

Hi Colleen,

I’m just coming back to the Nagios plugin now and have installed a missing lib 
that was required.  I’m now trying to test the plugin according to the 
instructions but I always receive a 404 when I execute:

[root@localhost libexec]# ./check_marklogic.pl -a admin:123 --H danspc -p 8002 
--path /manage/v1/databases --verbose 3
Input-Data:
-verbose  --> 3
-path  --> /manage/v1/databases
-authentication  --> admin:123
-port  --> 8002
-host  --> danspc
Starting Main Execution
Check-Default-parameters
-Default-parameters: specified
-Default-parameters: authentification=admin:123
-Default-parameters: host=danspc
-Default-parameters: port=8002
-Default-parameters: path=/manage/v1/databases
-checkOptionalArguments
Attention!!! Verbose should be used for debugging purposes only! (It shouldn't 
be specified when called out of Nagios)
-Optional-parameter: Verbose - specified:3
-Optional-parameter: SSL - not defined
-Optional-parameter: Key - not defined
-Optional-parameter: Timeout - not defined
-Optional-parameter: -w OR -c - not specified
ConstructCurlCommand
-Path: /manage/v1/databases
-Generated-Curl-Command: curl "http://danspc:8002/manage/v1/databases"; 
--max-time 10 --user admin:123 -i --anyauth -H "Accept: application/xml" 
--silent  2>&1
-Return-from-Curl: HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", 
nonce="33bf22c72dd890d5e19576f8c231caea", opaque="d48cc8fbaf286e51"
Content-type: text/html; charset=UTF-8
Server: MarkLogic
Content-Length: 1999
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 200 OK
Content-type: application/xml
Cache-Control: no-cache
Expires: -1
Server: MarkLogic
Content-Length: 3575
Connection: Keep-Alive
Keep-Alive: timeout=5

<database-default-list 
xsi:schemaLocation="http://marklogic.com/manage/databases manage-databases.xsd" 
xmlns="http://marklogic.com/manage/databases"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <meta>
    <uri>/manage/v1/databases</uri>
    <current-time>2013-07-09T16:37:30.33+01:00</current-time>
    <elapsed-time units="sec">0.007</elapsed-time>
  </meta>
  <list-items>
    <list-count units="quantity">16</list-count>
    <list-item array="true">
      <uriref>/manage/v1/databases/App-Services</uriref>
      <idref>8057607393266312780</idref>
      <nameref>App-Services</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Documents</uriref>
      <idref>14271765657077295025</idref>
      <nameref>Documents</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Extensions</uriref>
      <idref>7530902648671307172</idref>
      <nameref>Extensions</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Fab</uriref>
      <idref>10000952001037815352</idref>
      <nameref>Fab</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Last-Login</uriref>
      <idref>6473956695837004410</idref>
      <nameref>Last-Login</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Modules</uriref>
      <idref>11869533673437169677</idref>
      <nameref>Modules</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/roxy-content</uriref>
      <idref>3100704648796494438</idref>
      <nameref>roxy-content</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/roxy-content-xml</uriref>
      <idref>6927599911522589565</idref>
      <nameref>roxy-content-xml</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/roxy-modules</uriref>
      <idref>5470816150197939259</idref>
      <nameref>roxy-modules</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/sandbox</uriref>
      <idref>7970782390963938896</idref>
      <nameref>sandbox</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Schemas</uriref>
      <idref>1613915422614640277</idref>
      <nameref>Schemas</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Security</uriref>
      <idref>6808084361331031266</idref>
      <nameref>Security</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/top-songs-admin</uriref>
      <idref>15761147426355841514</idref>
      <nameref>top-songs-admin</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/top-songs-admin-modules</uriref>
      <idref>16531337767321153368</idref>
      <nameref>top-songs-admin-modules</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/top-songs-admin-triggers</uriref>
      <idref>1862846920905771677</idref>
      <nameref>top-songs-admin-triggers</nameref>
    </list-item>
    <list-item array="true">
      <uriref>/manage/v1/databases/Triggers</uriref>
      <idref>13577706583438689626</idref>
      <nameref>Triggers</nameref>
    </list-item>
  </list-items>
  <related-views>
    <related-view array="true">
      <view-type>root</view-type>
      <view-name>default</view-name>
      <view-uri>/manage/v1</view-uri>
    </related-view>
  </related-views>
</database-default-list>

Not Found (404): curl "http://danspc:8002/manage/v1/databases"; --max-time 10 
--user [username:pw] -i --anyauth -H "Accept: application/xml" --silent  2>&1
[root@localhost libexec]#


Looking at the verbose output it’s returning the correct XML but the plugin 
still fails, any ideas why this would happen?

Thanks

Dan



From: [email protected] 
[mailto:[email protected]] On Behalf Of Colleen Whitney
Sent: 21 June 2013 16:02
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working

It looks like it's not finding a perl module that is available on CPAN as part 
of the Nagios::Plugin module family.

Did you successfully install all of the required libraries?  
http://docs.marklogic.com/guide/monitoring/nagios#id_62455

If you did, then the next thing to think about is whether you've got all the 
paths you need in @INC.

________________________________
From: 
[email protected]<mailto:[email protected]>
 [[email protected]] on behalf of Gibbons, Daniel 
(RBI-UK) [[email protected]]
Sent: Friday, June 21, 2013 6:49 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] MarkLogic Nagios Plugin Not Working
Hi,

I’m trying to get the Nagios plugin working in OpsView (Nagios) but after 
following the instructions in the docs I get the following:

[root@localhost libexec]# ./check_marklogic.pl -a admin:admin -port 8002 -- 
host localhost -path /manage/v1/databases/documents
Can't locate Nagios/Plugin/Threshold.pm in @INC (@INC contains: 
/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl 
/usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at 
./check_marklogic.pl line 8.
BEGIN failed--compilation aborted at ./check_marklogic.pl line 8.

OS is Centos 6.4

Any suggestions how I can get this going or install the required plugin?

Thanks

Dan

===================== DISCLAIMER ======================
This message is intended only for the use of the person(s)
("Intended Recipient") to whom it is addressed. It may contain
information which is privileged and confidential. Accordingly
any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is
strictly prohibited. If you are not the Intended Recipient, please
contact the sender as soon as possible.

Reed Business Information Limited.
Registered Office: Quadrant House, The Quadrant, Sutton, Surrey, SM2 5AS, UK.
Registered in England under Company No. 151537

=======================================================
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to