Convert attachement bin to txt

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Convert attachement bin to txt

Post by vinothsethuram »

Long back I started a thread on same topic and I got below solution....

Code: Select all

"sed" program remove those line-endings before sendig it off to /bin/mail    i.e  | sed 's/\r//
After adding sed , I got content in email instead of attachment.

Yesterday again I got attachment for the following response. could you please help me to fix it?

Code: Select all

***** Nagios *****

Notification Type: PROBLEM

Service: Cart
Host: xml.domain.com
Address: xml.domain.com
State: WARNING

Date/Time: Wed Jan 15 04:02:01 EST 2014

Additional Info:

POST http://xml.domain.com/cart?id=ssdsd HTTP/1.1User-Agent: check_http/v1.5-3-gdc3f (nagios-plugins 1.5)
Connection: close
Host: xml.domain.com
WCToken:asdasdasdasd
Content-Type: application/json
Content-Length: 61

{order: [{ part_0:123456, quantity_0: 1 }]}

http://xml.domain.com:80http://xml.domain.com/cart?id=ssdsd is 350 characters
STATUS: HTTP/1.1 400 Bad Request
**** HEADER ****
Content-Language: en-US
Content-Type: application/json
Date: Wed, 15 Jan 2014 09:03:58 GMT
Content-Length: 188
Connection: Close
**** CONTENT ****
{
	errors: [
		{
			errorCode: 1012,
			errorKey: sdasda,
			errorMessage: Activitytokená0749249\hasbeenterminated.,
			errorParameters: dsadasd
		}
	]
}
HTTP WARNING: HTTP/1.1 400 Bad Request - 350 bytes in 0.117 second response time 
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Convert attachement bin to txt

Post by tmcdonald »

Just for reference, here is the other thread: http://support.nagios.com/forum/viewtop ... =7&t=22213

Did you make any changes to your notification commands? Any changes to anything at all? Something has to have changed.

Is this the only service doing this?
Former Nagios employee
vinothsethuram
Posts: 147
Joined: Thu Nov 07, 2013 11:44 am

Re: Convert attachement bin to txt

Post by vinothsethuram »

tmcdonald wrote:Just for reference, here is the other thread: http://support.nagios.com/forum/viewtop ... =7&t=22213

Did you make any changes to your notification commands? Any changes to anything at all? Something has to have changed.

Is this the only service doing this?

Above mentioned thread was started by me. Since that thread is locked, i started a new thread. I didn't change anything. For other serivces, i am getting content in email itself. For the response copied in last post, I am getting as attachment
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Convert attachement bin to txt

Post by abrist »

Can you show us the check command/service description that is causing this?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked