Convert attachement bin to txt
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
I need the exact file; you just copied+pasted the contents in your PM. I am trying to see if there are some weird line endings in your file that would cause /bin/mail to treat it as a .bin file. Can you also verify what version you are running?
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
Sent PM.
Version details
12.4 7/29/08
Version details
12.4 7/29/08
Re: Convert attachement bin to txt
Still not attaching the message, you're still copying and pasting the contents.
In the Nagios Support Forum, click "User Control Panel" in the upper-left-hand corner and go to the "Private messages" tab.
In the first box next to "Find a member" type in "tmcdonald"
In the text box labeled "Subject" type "Command definition"
In the biggest box type "Attaching config file"
Now you will need to save your "/usr/local/nagios/etc/commands.cfg" file (without quotes) to your desktop on Windows, using something like FTP or SCP. You will need to rename the file so it can properly be attached in your Nagios Support Forum private message to me. I want you to rename it to "commands.txt" instead of "commands.cfg". Sometimes it will try to save a "commands.cfg.txt" or "commands.txt.cfg" but it needs to be "commands.txt"
Back in the Nagios Support Forum page where you are sending the PM, click "Browse" down below next to where it says "Filename:" and select the "commands.txt" file. Click "Add the file" and finally hit "Submit".
In the Nagios Support Forum, click "User Control Panel" in the upper-left-hand corner and go to the "Private messages" tab.
In the first box next to "Find a member" type in "tmcdonald"
In the text box labeled "Subject" type "Command definition"
In the biggest box type "Attaching config file"
Now you will need to save your "/usr/local/nagios/etc/commands.cfg" file (without quotes) to your desktop on Windows, using something like FTP or SCP. You will need to rename the file so it can properly be attached in your Nagios Support Forum private message to me. I want you to rename it to "commands.txt" instead of "commands.cfg". Sometimes it will try to save a "commands.cfg.txt" or "commands.txt.cfg" but it needs to be "commands.txt"
Back in the Nagios Support Forum page where you are sending the PM, click "Browse" down below next to where it says "Filename:" and select the "commands.txt" file. Click "Add the file" and finally hit "Submit".
Former Nagios employee
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
Sorry for the inconvenience. Attached file in PM
Re: Convert attachement bin to txt
That was a .rtf file...
Are you actually moving the file off your server or are you copying and pasting the contents into Wordpad?
Are you actually moving the file off your server or are you copying and pasting the contents into Wordpad?
Former Nagios employee
Re: Convert attachement bin to txt
We need the file raw, copied from the server. Or, we may be able to fix the line endings from the cli. What distribution is running on your nagios server?
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.
"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.
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
sent file in PM . Moved file from Linux to Windows using smbclient. renamed .cfg to txt
-
vinothsethuram
- Posts: 147
- Joined: Thu Nov 07, 2013 11:44 am
Re: Convert attachement bin to txt
Using FEDORA distribution
Re: Convert attachement bin to txt
Exactly what I thought, windows line endings are sneaking in. I want you to edit your notify-service-by-email command to make the following change (adding sed 's/\r//' ):
This should remove the windows-style newline (that's what was causing /bin/mail to attach it as a bin).
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" | sed 's/\r//' | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}Former Nagios employee