Bunghi
April 3rd, 2008, 09:12 AM
Hi guys.
This is my second post in this great forum. I'm not an advanced linux user but I'm trying to resolve all the problems for myself.
I'm in a situation that I can't do more.. well.. there we go. I'm using Ubuntu 7.10 i386 Server edition because I want to use Hylafax as my fax server. All works fine but there are no reports about hylafax facsimiles, just a log file, the xferfaxlog file located in /var/spool/hylafax/log directory.
This is a xferfaxlog file:
03/30/08 03:09 SEND 000000007 ttyS0 1 "" anonymous@localhost "935872980" "" 2211880 0 0:09 0:00 "No local dialtone" "" "" "" "anonymous" "00 00 00"
03/30/08 03:14 SEND 000000008 ttyS0 1 "" anonymous@localhost "935872980" "" 2211880 0 1:06 0:00 "Unknown problem" "" "" "" "anonymous" "00 00 00"
03/30/08 03:35 SEND 000000009 ttyS0 4 "" anonymous@localhost "0935872980" "935872980" 3407912 0 0:18 0:04 "" "" "" "" "anonymous" "00 00 00"
03/30/08 03:38 SEND 000000010 ttyS0 5 "" cba@192.168.0.118 "0935872980" "935872980" 3416105 1 0:57 0:42 "" "" "" "" "cba" "00 00 00"
I use this simple awk script to generate an html file from this log file:
BEGIN {
FS = "\t"
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
print "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
print "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
print "<head><title>Informe</title>"
print "<style type=\"text/css\">"
print "table td { text-align: center; }"
print "</style>"
print "</head>"
print "<body>"
print "<h1 ALIGN=CENTER> INFORMES DE HYLAFAX </h1>"
print "<br> </br>"
print "<table width=\"100%\" border=\"1\">"
print "<tr>"
print "<td> <b>Fecha y Hora<!-- 1 --></b></td>"
print "<td> <b>Tipo <!-- 2 --></b</td>"
print "<td> <b>Job ID <!-- 5 --></b</td>"
print "<td> <b>Remitente/Fax <!-- 7 --></b</td>"
print "<td> <b>Destino/Local <!-- 8 --></b</td>"
print "<td> <b>Paginas <!-- 11 --></b</td>"
print "<td> <b>Error <!-- 14 --></b</td>"
print "</tr>"
}
{ print "<tr><td>" $1 "</td>", "<td>" $2 "</td>", "<td>" $5 "</td>", "<td>" $7 "</td>", "<td>" $8 "</td>", "<td>" $11 "</td>", "<td>" $14 "</td></tr>" }
END { print "</table></body></html>" }
.. and the html file was generated (attached file)
I'm using this script to get it work in the easier way (for me :):
#!/bin/bash
awk -f /etc/init.d/hylafaxlog/organiza.awt /var/spool/hylafax/log/xferfaxlog > /var/www/index.html
Well, now I want to convert the 4th column format in that way to show only the hostname, not the ip address. Ex: cba@192.168.0.118 -> cba@hostname
Sorry for my english. I hope somebody can help me. Thanks for all!
This is my second post in this great forum. I'm not an advanced linux user but I'm trying to resolve all the problems for myself.
I'm in a situation that I can't do more.. well.. there we go. I'm using Ubuntu 7.10 i386 Server edition because I want to use Hylafax as my fax server. All works fine but there are no reports about hylafax facsimiles, just a log file, the xferfaxlog file located in /var/spool/hylafax/log directory.
This is a xferfaxlog file:
03/30/08 03:09 SEND 000000007 ttyS0 1 "" anonymous@localhost "935872980" "" 2211880 0 0:09 0:00 "No local dialtone" "" "" "" "anonymous" "00 00 00"
03/30/08 03:14 SEND 000000008 ttyS0 1 "" anonymous@localhost "935872980" "" 2211880 0 1:06 0:00 "Unknown problem" "" "" "" "anonymous" "00 00 00"
03/30/08 03:35 SEND 000000009 ttyS0 4 "" anonymous@localhost "0935872980" "935872980" 3407912 0 0:18 0:04 "" "" "" "" "anonymous" "00 00 00"
03/30/08 03:38 SEND 000000010 ttyS0 5 "" cba@192.168.0.118 "0935872980" "935872980" 3416105 1 0:57 0:42 "" "" "" "" "cba" "00 00 00"
I use this simple awk script to generate an html file from this log file:
BEGIN {
FS = "\t"
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
print "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
print "<html xmlns=\"http://www.w3.org/1999/xhtml\">"
print "<head><title>Informe</title>"
print "<style type=\"text/css\">"
print "table td { text-align: center; }"
print "</style>"
print "</head>"
print "<body>"
print "<h1 ALIGN=CENTER> INFORMES DE HYLAFAX </h1>"
print "<br> </br>"
print "<table width=\"100%\" border=\"1\">"
print "<tr>"
print "<td> <b>Fecha y Hora<!-- 1 --></b></td>"
print "<td> <b>Tipo <!-- 2 --></b</td>"
print "<td> <b>Job ID <!-- 5 --></b</td>"
print "<td> <b>Remitente/Fax <!-- 7 --></b</td>"
print "<td> <b>Destino/Local <!-- 8 --></b</td>"
print "<td> <b>Paginas <!-- 11 --></b</td>"
print "<td> <b>Error <!-- 14 --></b</td>"
print "</tr>"
}
{ print "<tr><td>" $1 "</td>", "<td>" $2 "</td>", "<td>" $5 "</td>", "<td>" $7 "</td>", "<td>" $8 "</td>", "<td>" $11 "</td>", "<td>" $14 "</td></tr>" }
END { print "</table></body></html>" }
.. and the html file was generated (attached file)
I'm using this script to get it work in the easier way (for me :):
#!/bin/bash
awk -f /etc/init.d/hylafaxlog/organiza.awt /var/spool/hylafax/log/xferfaxlog > /var/www/index.html
Well, now I want to convert the 4th column format in that way to show only the hostname, not the ip address. Ex: cba@192.168.0.118 -> cba@hostname
Sorry for my english. I hope somebody can help me. Thanks for all!