wiki:plugin_netinfo

Version 2 (modified by anonymous, 9 years ago) (diff)

--

netinfo plugin

This plugin provides meta information about a network interface.


Functions

netinfo::exists(device)determine existence of network device
netinfo::hwaddr(device)get hardware address (usually MAC address)
netinfo::ipaddr(device)get IP address
netinfo::netmask(device)get netmask
netinfo::bcaddr(device)get broadcast address

'device' is a valid network device name, e.g. 'eth0' (do a 'cat /proc/net/dev' for valid names on your system)


Example

Widget IPaddress {                                                                                                                              
    class  'Text'                                                                                                                               
    expression netinfo::ipaddr('eth0')                                                                                                          
    prefix 'IP'                                                                                                                                 
    width  20                                                                                                                                   
    align  'R'                                                                                                                                  
    update minute                                                                                                                               
}