Convert attachement bin to txt
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Convert attachement bin to txt
Hi,
I'm using $LONGSERVICEOUTPUT$ to get the complete details of the issue.Notification/Alert email is attaching the file in .bin type. Is there any possibility to get the attachment as .txt file or sending the issue details in email body itself without attachment
Regards
I'm using $LONGSERVICEOUTPUT$ to get the complete details of the issue.Notification/Alert email is attaching the file in .bin type. Is there any possibility to get the attachment as .txt file or sending the issue details in email body itself without attachment
Regards
Re: Convert attachement bin to txt
That's very odd. Is the .bin file human-readable text?
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
Yes, bin file is human readable in Windows but not in mac os
Re: Convert attachement bin to txt
What attachment are you referring to? Can you PM me the file in question?
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
I'm using $LONGSERVICEOUTPUT$ which attaches the issue details. The attached file type in .bin.
Re: Convert attachement bin to txt
I'm not entirely clear on what's happening here since (as far as I know) Nagios should not be attaching anything in the first place. Can you post the full email notification command you have defined? And can you please PM a copy of the .bin attachment?
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
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$LONGSERVICEOUTPUT$\n " | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
This is the command used to send email. If I use $SERVICEOUTPUT$ then there is no attachment in email ,but getting limited details. If I use $LONGSERVICEOUTPUT$ then email is attaching a bin file which has complete issue details
I tried to PM you, but couldn't attach the bin file
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$LONGSERVICEOUTPUT$\n " | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
This is the command used to send email. If I use $SERVICEOUTPUT$ then there is no attachment in email ,but getting limited details. If I use $LONGSERVICEOUTPUT$ then email is attaching a bin file which has complete issue details
I tried to PM you, but couldn't attach the bin file
Re: Convert attachement bin to txt
Can you just change the extension to .txt and PM it?
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
Seems to be perfectly readable. Try changing your command to show $SERVICEOUTPUT$ right before the $LONGSERVICEOUTPUT$:
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