Debian Codegraph @

perl/AnyData_SNMP/configs/unix

raw
1 # example ifconfig command
2 alias ifconfig {
3 printf "%-10sinet addr: %-15s Mask: %-10s\n %s %s RUNNING:%s MTU:%d\n RX packets: %d errors: %d dropped: %d\n TX packets: %d errors: %d dropped: %d\n RX bytes:%d TX bytes: %d\n\n" select ifDescr, ipAdEntAddr, ipAdEntNetMask, ifAdminStatus, ifType, ifOperStatus, ifMtu, ifInUcastPkts, ifInErrors, ifInDiscards, ifOutUcastPkts, ifOutErrors, ifOutDiscards, ifInOctets, ifOutOctets, ifIndex, ipAdEntIfIndex from ifTable, ipAddrTable where ifIndex = ipAdEntIfIndex
4 # select ipAdEntAddr, ifDescr, ifIndex, ipAdEntIfIndex from ifTable, ipAddrTable where ifIndex = ipAdEntIfIndex
5 }
6
7 # equivelant to netstat -an
8 alias netstatan {
9 printf "Active Intenet connections (servers and established)\n"
10 printf "Proto LocalAddress Foreign Address State\n"
11 printf "tcp %-15s:%-5s %-15s:%-5s%-10s\n" select tcpConnLocalAddress, tcpConnLocalPort, tcpConnRemAddress, tcpConnRemPort, tcpConnState from tcpConnTable;
12 printf "udp %-15s:%-5s 0.0.0.0:0 %-10s\n" select udpLocalAddress, udpLocalPort from udpTable;
13 }
14
15 # equivelent to netstat -rn
16 alias netstatrn {
17 printf "Kernel IP Routing Table\n"
18 printf "Destination Gateway Genmask Type Iface\n"
19 printf "%-15s %-15s %-15s %-8s %s\n" select ipRouteDest, ipRouteNextHop, ipRouteMask, ipRouteType, ifDescr, ifIndex, ipRouteIfIndex from ifTable, ipRouteTable where ifIndex = ipRouteIfIndex
20 }
21
22 alias ps {
23 printf "%6d %1d %s %40.40s\n" select hrSWRunIndex, hrSWRunType, hrSWRunName, hrSWRunParameters from hrSWRunTable
24 # printf "%6d %1d %6d %s %40.40s\n" select hrSWRunIndex, hrSWRunType, hrSWRunPerfMem, hrSWRunName, hrSWRunParameters from hrSWRunTable
25 }
26
27 alias ps_grep {
28 printf "%6d %1d %s %40.40s\n" select hrSWRunIndex, hrSWRunType, hrSWRunName, hrSWRunParameters from hrSWRunTable where hrSWRunName like '%\1%'
29 }
30
31 alias df {
32 printf "Filesystem Size Used\n"
33 printf "%-20s %8d %8d\n" select hrStorageDescr, hrStorageSize, hrStorageUsed from hrStorageTable
34 }