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/12 22:25:17 UTC
Sending Nagios Passive Checks from Spring - HowTo ?
Hi,
I tried sending Nagios passive checks from Spring using the following code,
and Nagios didn't receive them:
<camel:route>
<camel:from uri="file:/path/input/Nagios?noop=true" />
<camel:to uri="nagios://nagHost:5667?password=secret" />
</camel:route>
Then I looked up on the Camel website and I found this: In Spring XML it's
just a matter of defining a Spring bean with the type EventNotifier and
Camel will pick it up as documented here: EventNotifier 0..n Camel 2.2:
To use 3rd part event notifiers. I'm sorry, that is not quite clear to me
(What does it mean by 3rd part ?). Could you provide me with an example, as
in, what should I add to my Spring code to get the message sent properly to
Nagios ?
Thanks,
Tereza
--
View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4694564.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Mathieu Lalonde <mr...@live.ca>.
Hi,
I've attached a unit test to the jira issue CAMEL-4332; it seems to be already working.
>From the svn history, it looks like the NagiosProducer always did:
exchange.getIn().getBody(String.class);
which should trigger type conversion.
Can you confirm if your route still works without the explicit convertBodyTo(String.class)?
Cheers,
Mathieu
----------------------------------------
> Date: Mon, 15 Aug 2011 18:36:00 -0700
> From: tnedelescu@tagged.com
> To: users@camel.apache.org
> Subject: Re: Sending Nagios Passive Checks from Spring - HowTo ?
>
> I fixed the problem. Data is being sent from Camel to Nagios, but there is an
> incompatibility with the Nagios protocol, so Nagios is not getting it.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4702956.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Tereza Nedelescu <tn...@tagged.com>.
I fixed the problem. Data is being sent from Camel to Nagios, but there is an
incompatibility with the Nagios protocol, so Nagios is not getting it.
--
View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4702956.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Tereza Nedelescu <tn...@tagged.com>.
Also, what I am trying to do in this example is to send passive checks to
Nagios. Is this the correct way to do it ?
Thank you
--
View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4702785.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Tereza Nedelescu <tn...@tagged.com>.
Hi,
Yes, I will gladly contribute in a few weeks, but now I have to finish a
project and I want to get it working first.
I solved the socket issue I mentioned earlier, it was from the firewall.
Now I have this Spring code:
<camel:route>
<camel:from uri="file:path/input/Nagios?noop=true" />
<camel:convertBodyTo type="java.lang.String"/>
<camel:multicast>
<camel:pipeline>
<camel:to uri="stream:out" />
</camel:pipeline>
<camel:pipeline>
<camel:to uri="nagios://nagHost:5667?password=secret" />
</camel:pipeline>
</camel:multicast>
</camel:route>
The text in the file is going in the output stream, but I don't see it in
the Nagios log. There is no error complaining that the message is not
transmitted to Nagios. When I saw this, I changed the Nagios port to
something else. It gave an error, so it is trying to connect to Nagios. Then
I changed the port to the correct one, there was no more error, but again,
the message is still not being transmitted to Nagios. Please, let me know
what's wrong with this case.
Thank you,
Tereza
--
View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4702782.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
I have logged a ticket to improve this in camel-nagios in the future
https://issues.apache.org/jira/browse/CAMEL-4332
If you want you are welcome to submit a patch to fix this. This way
you will learn a bit about the nagios code in Camel.
You can read more about contributing here
http://camel.apache.org/contributing.html
On Sat, Aug 13, 2011 at 10:09 PM, Tereza Nedelescu
<tn...@tagged.com> wrote:
> Thank you, that started things going. Now I have another error:
>
> Exhausted after delivery attempt: 1 caught: java.net.SocketTimeoutException:
> connect timed out
> java.net.SocketTimeoutException: connect timed out
> 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)
>
> I'm assuming this means I cannot connect to Nagios, so it's an external
> problem. Is this the case ?
>
> Thanks,
> Tereza
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4696985.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: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Tereza Nedelescu <tn...@tagged.com>.
Thank you, now I see that it's an external problem: it cannot connect to
Nagios.
--
View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4697035.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by David Karlsen <da...@gmail.com>.
Yes, while attempting to connect it timed out.
You can debug by issing "telnet hostname port" or "telnet host:port" on the
command line.
2011/8/13 Tereza Nedelescu <tn...@tagged.com>
> Thank you, that started things going. Now I have another error:
>
> Exhausted after delivery attempt: 1 caught:
> java.net.SocketTimeoutException:
> connect timed out
> java.net.SocketTimeoutException: connect timed out
> 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)
>
> I'm assuming this means I cannot connect to Nagios, so it's an external
> problem. Is this the case ?
>
> Thanks,
> Tereza
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4696985.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
Re: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Tereza Nedelescu <tn...@tagged.com>.
Thank you, that started things going. Now I have another error:
Exhausted after delivery attempt: 1 caught: java.net.SocketTimeoutException:
connect timed out
java.net.SocketTimeoutException: connect timed out
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)
I'm assuming this means I cannot connect to Nagios, so it's an external
problem. Is this the case ?
Thanks,
Tereza
--
View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4696985.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Sending Nagios Passive Checks from Spring - HowTo ?
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Aug 12, 2011 at 10:25 PM, Tereza Nedelescu
<tn...@tagged.com> wrote:
> Hi,
>
> I tried sending Nagios passive checks from Spring using the following code,
> and Nagios didn't receive them:
>
> <camel:route>
> <camel:from uri="file:/path/input/Nagios?noop=true" />
> <camel:to uri="nagios://nagHost:5667?password=secret" />
> </camel:route>
>
> Then I looked up on the Camel website and I found this: In Spring XML it's
> just a matter of defining a Spring bean with the type EventNotifier and
> Camel will pick it up as documented here: EventNotifier 0..n Camel 2.2:
> To use 3rd part event notifiers. I'm sorry, that is not quite clear to me
> (What does it mean by 3rd part ?). Could you provide me with an example, as
> in, what should I add to my Spring code to get the message sent properly to
> Nagios ?
>
You may need to convert the file to a String before sending to nagios
<camel:from uri="file:/path/input/Nagios?noop=true" />
<camel:convertBodyTo type="java.lang.String"/>
<camel:to uri="nagios://nagHost:5667?password=secret" />
> Thanks,
> Tereza
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Sending-Nagios-Passive-Checks-from-Spring-HowTo-tp4694564p4694564.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/