You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tereza Nedelescu <tn...@tagged.com> on 2011/08/18 13:45:30 UTC

Nagios, unknown cause: connection refused

Hi, 

I have 2 scenarios: 
*Case 1 - *  Code 1.1:
   <bean id="nSettings" class="com.googlecode.jsendnsca.core.NagiosSettings"
>
        <property name="encryptionMethod" value="3"/>
        <property name="password" value="secret" />
  </bean>

or Code 1.2
  <bean id="nSettings" class="com.googlecode.jsendnsca.core.NagiosSettings"
>
        <property name="password" value="secret" />
  </bean>

followed by:

    <camel:route>
	<camel:from uri="file:path/Nagios?noop=true" />
	<camel:convertBodyTo type="java.lang.String"/>
	<camel:to uri="nagios://nagios:5667?nagiosSettings=#nSettings" />
    </camel:route> 

give the following error and do not send packets to port 5667: (I verified
that nagios uses 3DES)

java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at
com.googlecode.jsendnsca.core.NagiosPassiveCheckSender.send(NagiosPassiveCheckSender.java:69)
        at
org.apache.camel.component.nagios.NagiosProducer.process(NagiosProducer.java:60)

  *Case 2* The following code doesn't give an error, sends packets down the
port, but they are not recognized because I don't specify the encryption:

    <camel:route>
	<camel:from uri="file:path/Nagios?noop=true" />
	<camel:convertBodyTo type="java.lang.String"/>
	<camel:to uri="nagios://nagios:5667?password=secret" />      // password is
the same as in Case 1
    </camel:route>

*Question: * What's wrong with Case 1 ? I want to send a message to Nagios
using a password and encryption and it refuses the connection without saying
why. Please, help me figure it out. 


Thanks,
Tereza


--
View this message in context: http://camel.465427.n5.nabble.com/Nagios-unknown-cause-connection-refused-tp4711803p4711803.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Nagios, unknown cause: connection refused

Posted by Claus Ibsen <cl...@gmail.com>.
When you use NagiosSetting you must configure *all* the options. Its
all or nothing.
So you have to configure the host and portname also.

This is how the current code works.


On Thu, Aug 18, 2011 at 1:45 PM, Tereza Nedelescu <tn...@tagged.com> wrote:
> Hi,
>
> I have 2 scenarios:
> *Case 1 - *  Code 1.1:
>   <bean id="nSettings" class="com.googlecode.jsendnsca.core.NagiosSettings"
>>
>        <property name="encryptionMethod" value="3"/>
>        <property name="password" value="secret" />
>  </bean>
>
> or Code 1.2
>  <bean id="nSettings" class="com.googlecode.jsendnsca.core.NagiosSettings"
>>
>        <property name="password" value="secret" />
>  </bean>
>
> followed by:
>
>    <camel:route>
>        <camel:from uri="file:path/Nagios?noop=true" />
>        <camel:convertBodyTo type="java.lang.String"/>
>        <camel:to uri="nagios://nagios:5667?nagiosSettings=#nSettings" />
>    </camel:route>
>
> give the following error and do not send packets to port 5667: (I verified
> that nagios uses 3DES)
>
> java.net.ConnectException: Connection refused
> java.net.ConnectException: Connection refused
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>        at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>        at java.net.Socket.connect(Socket.java:529)
>        at
> com.googlecode.jsendnsca.core.NagiosPassiveCheckSender.send(NagiosPassiveCheckSender.java:69)
>        at
> org.apache.camel.component.nagios.NagiosProducer.process(NagiosProducer.java:60)
>
>  *Case 2* The following code doesn't give an error, sends packets down the
> port, but they are not recognized because I don't specify the encryption:
>
>    <camel:route>
>        <camel:from uri="file:path/Nagios?noop=true" />
>        <camel:convertBodyTo type="java.lang.String"/>
>        <camel:to uri="nagios://nagios:5667?password=secret" />      // password is
> the same as in Case 1
>    </camel:route>
>
> *Question: * What's wrong with Case 1 ? I want to send a message to Nagios
> using a password and encryption and it refuses the connection without saying
> why. Please, help me figure it out.
>
>
> Thanks,
> Tereza
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Nagios-unknown-cause-connection-refused-tp4711803p4711803.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Nagios, unknown cause: connection refused

Posted by Tereza Nedelescu <tn...@tagged.com>.
Thanks a lot, now I see my message in the nagios log. It works fine and there
are no more errors. 


--
View this message in context: http://camel.465427.n5.nabble.com/Nagios-unknown-cause-connection-refused-tp4711803p4711950.html
Sent from the Camel - Users mailing list archive at Nabble.com.