Issue in configuring Nagios Appender
Anand, Sakshi
sa185043 at ncr.com
Wed Mar 23 17:36:19 CET 2011
Thanks Lyons.
I suspected this to be the issue too.
Initially I was not using any encryption or password for these checks but after this exception, I made changes in nsca.cfg (on server) and nsca_send.cfg (on client) to set encryption/decryption method and password, but no use. I keep getting same error with any combination of these values. :(
Is there some other way of debugging the issue?
Regards,
Sakshi Anand
________________________________
From: Jarlath Lyons [mailto:Jarlath.Lyons at Tideworks.com]
Sent: Wednesday, March 23, 2011 9:48 PM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
Here is my file ... just make sure that the value used for encryption_method is the same value used by the server (decryption_method). (NOTE: The log4j appender only supports 0 and 1 currently .. hope that works for you ....)
---------- file start
####################################################
# Sample NSCA Client Config File
# Written by: Ethan Galstad (nagios at nagios.org)
#
# Last Modified: 02-21-2002
####################################################
# ENCRYPTION PASSWORD
# This is the password/passphrase that should be used to encrypt the
# outgoing packets. Note that the nsca daemon must use the same
# password when decrypting the packet!
# IMPORTANT: You don't want all the users on this system to be able
# to read the password you specify here, so make sure to set
# restrictive permissions on this config file!
#password=
# ENCRYPTION METHOD
# This option determines the method by which the send_nsca client will
# encrypt the packets it sends to the nsca daemon. The encryption
# method you choose will be a balance between security and performance,
# as strong encryption methods consume more processor resources.
# You should evaluate your security needs when choosing an encryption
# method.
#
# Note: The encryption method you specify here must match the
# decryption method the nsca daemon uses (as specified in
# the nsca.cfg file)!!
# Values:
# 0 = None (Do NOT use this option)
# 1 = Simple XOR (No security, just obfuscation, but very fast)
#
# 2 = DES
# 3 = 3DES (Triple DES)
# 4 = CAST-128
# 5 = CAST-256
# 6 = xTEA
# 7 = 3WAY
# 8 = BLOWFISH
# 9 = TWOFISH
# 10 = LOKI97
# 11 = RC2
# 12 = ARCFOUR
#
# 14 = RIJNDAEL-128
# 15 = RIJNDAEL-192
# 16 = RIJNDAEL-256
#
# 19 = WAKE
# 20 = SERPENT
#
# 22 = ENIGMA (Unix crypt)
# 23 = GOST
# 24 = SAFER64
# 25 = SAFER128
# 26 = SAFER+
#
encryption_method=0
---------- file end
Jar Lyons
Senior Software Engineer
Tideworks Technology, Inc.
(206) 344-3016
[cid:533393216 at 23032011-1FEA]
From: Anand, Sakshi [mailto:sa185043 at ncr.com]
Sent: Wednesday, March 23, 2011 9:07 AM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
Lyons,
I do have access to the server too. However, I am not able to understand which line in the below file tells which encryption scheme needs to be used.
Please confirm.
Thanks & Regards,
Sakshi Anand
________________________________
From: Jarlath Lyons [mailto:Jarlath.Lyons at Tideworks.com]
Sent: Wednesday, March 23, 2011 8:46 PM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
You need to make sure that you tell send_nsca to use the same encryption scheme that the server is using. Since you're the client, you don't control this .... The server will have it's own file specified .....
On my server .....
[root at jlyonslx test_harness]# cat /etc/xinetd.d/nsca
# default: on
# description: The nsca service can deliver nagios commands to the nagios server
service nsca
{
disable = no
flags = REUSE
port = 5667
socket_type = stream
protocol = tcp
wait = no
user = nagios
group = nagios
passenv = PATH
server = /usr/local/nagios/addons/nsca/nsca
# env = HOME=/usr/local/nagios
server_args = -c /usr/local/nagios/addons/nsca/nsca.cfg --inetd
# bind = 127.0.0.1
}
The simplest thing to do is copy the nsca.cfg file to anywhere you need it when running the client .....
Jar Lyons
Senior Software Engineer
Tideworks Technology, Inc.
(206) 344-3016
[cid:533393216 at 23032011-1FEA]
From: Anand, Sakshi [mailto:sa185043 at ncr.com]
Sent: Tuesday, March 22, 2011 9:35 PM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
Thanks Again. It helped.
Now, I am stuck with following exception -
Received invalid packet type/version from client - possibly due to client using wrong password or crypto algorithm?
I am not using any password and the decryption_method is set to 0 in nsca.cfg file.
What can be the possible cause of the error then?
Thanks & Regards,
Sakshi Anand
________________________________
From: Jarlath Lyons [mailto:Jarlath.Lyons at Tideworks.com]
Sent: Tuesday, March 22, 2011 8:48 PM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
Try shortening the name you are using, and at least remove the space between Connection and Monitoring.
Jar Lyons
Senior Software Engineer
Tideworks Technology, Inc.
(206) 344-3016
[cid:533393216 at 23032011-1FEA]
From: Anand, Sakshi [mailto:sa185043 at ncr.com]
Sent: Monday, March 21, 2011 11:13 PM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
Thanks Lyons.
Now, after adding the appender-ref, I am getting following exception -
log4j:ERROR Parsing error on line 18 and column 94
log4j:ERROR Attribute value "NAGIOS-Connection Monitoring" of type ID must be a name.
log4j:ERROR Parsing error on line 47 and column 54
log4j:ERROR Attribute value "NAGIOS-Connection Monitoring" of type IDREF must be a name.
Does anyone have any idea about reason of this error.
Thanks & Regards,
Sakshi Anand
________________________________
From: Jarlath Lyons [mailto:Jarlath.Lyons at Tideworks.com]
Sent: Monday, March 21, 2011 8:39 PM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
It appears the appender is correctly defined, but just not linked to the root logger ....
Try this ...
<root>
<level value="DEBUG" />
<appender-ref ref="CA" />
<appender-ref ref="FA" />
<appender-ref ref="NAGIOS-Connection Monitoring" />
</root>
Jar Lyons
Senior Software Engineer
Tideworks Technology, Inc.
(206) 344-3016
[cid:533393216 at 23032011-1FEA]
From: Anand, Sakshi [mailto:sa185043 at ncr.com]
Sent: Monday, March 21, 2011 5:14 AM
To: Nagios Users List
Subject: Re: [Nagios-users] Issue in configuring Nagios Appender
Plz help.
Regards,
Sakshi Anand
________________________________
From: Anand, Sakshi
Sent: Sunday, March 20, 2011 11:31 PM
To: Nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Issue in configuring Nagios Appender
All,
I am trying to configure nagios appender for one of my applications which is using log4j to log data. Also, my NSCA configuration is running fine.
However, I am not able to send checks from the application using nagios appender.
Following is what my log4j.xml looks like (it is successfully writing to console and to log file too) -
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="CA" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n" />
</layout>
</appender>
<appender name="FA" class="org.apache.log4j.FileAppender">
<param name="File" value="C:\\eclipse\\workspace2\\NSCA-PassiveChecks\\nagiosAppenderDemo\\Log4jDemo.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-4r [%t] %-5p %c %x - %m%n" />
</layout>
</appender>
<appender class="org.apache.log4j.nagios.NagiosAppender" name="NAGIOS-Connection Monitoring">
<param name="Host" value="rpc1934.daytonoh.ncr.com"/>
<param name="Port" value="5667"/>
<param name="ServiceNameDefault" value="uContainer"/>
<param name="useMDCServiceName" value="false"/>
<param name="useMDCHostName" value="false"/>
<param name="useShortHostName" value="false"/>
<param name="Log4j_Level_ERROR" value="NAGIOS_CRITICAL"/>
<param name="Log4j_Level_FATAL" value="NAGIOS_CRITICAL"/>
<param name="ExcludeFilterEnabled" value="true"/>
<param name="PatternFilterFile" value="NagiosIncludeExcludeFilters.properties"/>
<param name="SendStartupMessageOK" value="Application Errors Cleared"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="server: %X{Connection Monitoring}: %m%n"/>
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="CA" />
<appender-ref ref="FA" />
</root>
</log4j:configuration>
Please help me in finding the issue and a way to debug it.
Thanks & Regards,
Sakshi Anand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110323/56725321/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 8228 bytes
Desc: image001.png
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110323/56725321/attachment.png>
-------------- next part --------------
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list