Ohhhh it is impossible my awk doesn´t do nothing. I don´t know what to
do. I have test the awk command basicaly by: ls -l | awk '{print $1}' but it doesn't respond nothing Any idea about? Please help me. Ken Irving wrote: On Sat, Feb 02, 2008 at 01:20:38AM +0100, Javier Martínez wrote:If a run#bash -x javier1 ++ /sbin/iptables -L vpn1-in -vxn ++ /usr/bin/awk 'BEGIN { getline ; getline } { print $2 }' ++ /usr/bin/tr ' ' : ++ /bin/sed -e 's/:$//' + /usr/bin/rrdtool update vpn1-in.rrd N: ERROR: expected 6 data source readings (got 1) from N: ----------------------------------------- where do i have the mistake? i have introduced with command "o" on vi editor, after the "tr ' " but it doesn´t work yet. ... Javier Martínez wrote: I have followed this script, but it reports me an error. What i do is this: # /sbin/iptables -L vpn1-in -vxn Chain vpn1-in (6 references) pkts bytes target prot opt in out source destination 81172 4220945 all -- ppp0 * 192.168.1.100 0.0.0.0/0 0 0 all -- ppp0 * 192.168.1.101 0.0.0.0/0 0 0 all -- ppp0 * 192.168.1.102 0.0.0.0/0 0 0 all -- ppp0 * 192.168.1.103 0.0.0.0/0 0 0 all -- ppp0 * 192.168.1.104 0.0.0.0/0 0 0 all -- ppp0 * 192.168.1.105 0.0.0.0/0 and i make a cron with this file, that respond me with an error: #sh javier1 ERROR: expected 6 data source readings (got 1) from N: where the content of javier1 is: # more javier1 # /usr/bin/rrdtool update vpn1-in.rrd N:`/sbin/iptables -L vpn1-in -vxn | \ /usr/bin/awk 'BEGIN { getline ; getline } { print $2 }' | \ /usr/bin/tr ' ' ':' | /bin/sed -e 's/:$//'`I'm not familiar with most of the programs you're using, but would suggest breaking the problem down to check the output of each stage before continuing to pipe it into the next one. E.g., the sed pipe isn't going to do anything good if it's got garbage coming in (whether it has or hasn't I have no idea). If, in the awk snippet, you're trying to ignore the first two lines of the content you show above, I'm not sure using the BEGIN block will do that; instead, maybe try: /usr/bin/awk 'NR>2 { print $2 }' which explicitly says to only do the action if the line count > 2. --
Javier
Martínez Sip2000
Sistemas Advertencia: Esta comunicación está destinada a la persona a quién se dirige y puede contener información confidencial o sometida a secreto profesional. Su interceptación, utilización, alteración, reproducción, difusión, cesión a terceros y / o uso de su contenido puede constituir un delito. Si Vd. no es el destinatario de este mensaje, por favor, destrúyalo o devuélvalo al remitente. En cumplimiento de la Ley Orgánica 15/1999 de 13 de diciembre, de protección de datos de carácter personal, se le informa que la dirección de correo electrónico por usted facilitada va a ser incorporada a un fichero automatizado denominado AGENDAS DE CORREO cuyo responsable es SIP2000 SISTEMAS. La recogida de estos datos tiene por finalidad posibilitar la gestión económico-administrativa y comercial de la empresa. La información facilitada por usted tiene como único destinatario a la empresa responsable de los datos SIP2000 SISTEMAS. En todo caso, usted puede en cualquier momento ejercitar los derechos de acceso, rectificación, cancelación y oposición dirigiéndose por escrito al encargado de los derechos de los afectados de SIP2000 SISTEMAS en C/ Luis Morondo, 11 Bajo. 31006 - Pamplona (Navarra). |
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Shorewall-users mailing list Shorewall-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/shorewall-users