Remote mongodb host

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Remote mongodb host

Sar Haidar
I’m trying to use monit to verify the connection between a host running monit and another host running mongodb. I was successfully able to write a rule to do that for mysql, however, when I try it for mongodb, it fails and I’m not sure what the correct syntax should be. This is what I have so far:

check host mongodb-host with address mongodb-server.example.com
if failed port 27017 protocol mongodb username “monit" password “test" then exec "/bin/sh -c /usr/local/bin/slack.sh”

When I run monit -t I get a syntax error ‘username’

I tried a few different ways and nothing seemed to work. Only way I was able to make it work was by not using a username and password, but that only works in a test case and not anywhere else.
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Remote mongodb host

martinp@tildeslash.com
The mongodb protocol test doesn't support an username and password



> On 7 Mar 2018, at 22:09, Sar Haidar <[hidden email]> wrote:
>
> I’m trying to use monit to verify the connection between a host running monit and another host running mongodb. I was successfully able to write a rule to do that for mysql, however, when I try it for mongodb, it fails and I’m not sure what the correct syntax should be. This is what I have so far:
>
> check host mongodb-host with address mongodb-server.example.com
> if failed port 27017 protocol mongodb username “monit" password “test" then exec "/bin/sh -c /usr/local/bin/slack.sh”
>
> When I run monit -t I get a syntax error ‘username’
>
> I tried a few different ways and nothing seemed to work. Only way I was able to make it work was by not using a username and password, but that only works in a test case and not anywhere else.--
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
Reply | Threaded
Open this post in threaded view
|

Re: Remote mongodb host

Sar Haidar
Thanks for the clarification. Would it work if I embed the credentials in the connection string?

> On Mar 7, 2018, at 4:15 PM, [hidden email] wrote:
>
> The mongodb protocol test doesn't support an username and password
>
>
>
>> On 7 Mar 2018, at 22:09, Sar Haidar <[hidden email]> wrote:
>>
>> I’m trying to use monit to verify the connection between a host running monit and another host running mongodb. I was successfully able to write a rule to do that for mysql, however, when I try it for mongodb, it fails and I’m not sure what the correct syntax should be. This is what I have so far:
>>
>> check host mongodb-host with address mongodb-server.example.com
>> if failed port 27017 protocol mongodb username “monit" password “test" then exec "/bin/sh -c /usr/local/bin/slack.sh”
>>
>> When I run monit -t I get a syntax error ‘username’
>>
>> I tried a few different ways and nothing seemed to work. Only way I was able to make it work was by not using a username and password, but that only works in a test case and not anywhere else.--
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general

--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general

smime.p7s (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Remote mongodb host

martinp@tildeslash.com
No, the monit protocol test is basic implementation of the mongodb protocol - not full client.

If you need more complex test, you can use the "check program" with custom script that can use a mongodb client:



> On 7 Mar 2018, at 22:20, Sar Haidar <[hidden email]> wrote:
>
> Thanks for the clarification. Would it work if I embed the credentials in the connection string?
>
>> On Mar 7, 2018, at 4:15 PM, [hidden email] wrote:
>>
>> The mongodb protocol test doesn't support an username and password
>>
>>
>>
>>> On 7 Mar 2018, at 22:09, Sar Haidar <[hidden email]> wrote:
>>>
>>> I’m trying to use monit to verify the connection between a host running monit and another host running mongodb. I was successfully able to write a rule to do that for mysql, however, when I try it for mongodb, it fails and I’m not sure what the correct syntax should be. This is what I have so far:
>>>
>>> check host mongodb-host with address mongodb-server.example.com
>>> if failed port 27017 protocol mongodb username “monit" password “test" then exec "/bin/sh -c /usr/local/bin/slack.sh”
>>>
>>> When I run monit -t I get a syntax error ‘username’
>>>
>>> I tried a few different ways and nothing seemed to work. Only way I was able to make it work was by not using a username and password, but that only works in a test case and not anywhere else.--
>>> To unsubscribe:
>>> https://lists.nongnu.org/mailman/listinfo/monit-general
>>
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general


--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general