/*
* udpstat.d - print UDP statistics. Uses DTrace.
*
* This prints UDP statistics every second, retrieved from the MIB provider.
*
* $Id: udpstat.d 59 2007-10-03 08:21:58Z brendan $
*
* USAGE: udpstat.d
*
* FIELDS:
* UDP_out UDP datagrams sent
* UDP_outErr UDP datagrams errored on send
* UDP_in UDP datagrams received
* UDP_inErr UDP datagrams undeliverable
* UDP_noPort UDP datagrams received to closed ports
*
* The above UDP statistics are documented in the mib2_udp struct
* chapter of the DTrace Guide, http://docs.oracle.com/cd/E23824_01/html/E22973.
*
* COPYRIGHT: Copyright (c) 2005 Brendan Gregg.
*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* See the License for the specific language governing permissions
* and limitations under the License.
*
* CDDL HEADER END
*
* 25-Jul-2005 Brendan Gregg Created this.
* 25-Jul-2005 " " Last update.
*/
/*
* Declare Globals
*/
{
}
/*
* Print Header
*/
/line <= 0 /
{
printf("%11s %11s %11s %11s %11s\n",
"UDP_out", "UDP_outErr", "UDP_in", "UDP_inErr", "UDP_noPort");
}
/*
* Save Data
*/
/*
* Print Output
*/
{
printf("%11d %11d %11d %11d %11d\n",
/* clear values */
UDP_out = 0;
UDP_outErr = 0;
UDP_in = 0;
UDP_inErr = 0;
UDP_noPort = 0;
}