Convert attachement bin to txt
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
$SERVICEOUTPUT$ will give the few details in email. But $LONGSERVICEOUTPUT$ is responsible for attaching .bin file. I need to convert it to .txt
Re: Convert attachement bin to txt
Yep. Try changing your command to show $SERVICEOUTPUT$ right before the $LONGSERVICEOUTPUT$:vinothsethuram wrote:$SERVICEOUTPUT$ will give the few details in email. But $LONGSERVICEOUTPUT$ is responsible for attaching .bin file. I need to convert it to .txt
Code: Select all
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$\n " | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
Adding $SERVICEOUTPUT$ will not change the file type .bin to .txt
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
Added SERVICEOUTPUT. But still getting file as .bin
Re: Convert attachement bin to txt
Okay, and now can you PM that new file?vinothsethuram wrote:Added SERVICEOUTPUT. But still getting file as .bin
Former Nagios employee
Re: Convert attachement bin to txt
Do me a favor and check the file type of the .bin file on the linux server:
I think line endings might be screwing up the mailx client:
http://superuser.com/questions/309530/p ... a-bin-file
http://whynotwiki.com/Line_endings
Code: Select all
file ATT00002.binhttp://superuser.com/questions/309530/p ... a-bin-file
http://whynotwiki.com/Line_endings
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
No such files(ATT....bin) in my Linux machine
Re: Convert attachement bin to txt
I guess I worded that poorly:
Transfer the file to your linux machine and then run the command to check the file type.
Transfer the file to your linux machine and then run the command to check the file type.
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
I transferred the file using smbclient and checked the file mime type.
mime type:- text/plain
mime encoding :- us-ascii
ASCII text, with CRLF, LF line terminators
But email is having attachment as .bin. confused...
Thanks
Vinoth
mime type:- text/plain
mime encoding :- us-ascii
ASCII text, with CRLF, LF line terminators
But email is having attachment as .bin. confused...
Thanks
Vinoth
Re: Convert attachement bin to txt
Can you PM me an exact copy of your /usr/local/nagios/etc/commands.cfg file?
In addition what is your mail version?
In addition what is your mail version?
Code: Select all
mail -VFormer Nagios employee