CODE EXAMPLE 1-1System Watchdog Node Management Code Example (Continued)

#define EM_INIT

1

#define EM_GETROOT

2

#define EM_GETPVALBYNAME

3

#define USAGE_STR

"Usage:\n"\

"wdadm -l [<controller_name:timer_name>...]\n"\

"wdadm -m <controller_name:timer_name> [-t <timeout>]"\

" [-a action]]\n"\

"wdadm -c <controller_name> -o <op>\n"

#define DETAILED_HELP "wdadm - System Watchdog Controller Administration\n"\ "Description:\n"\

"The operations include displaying status (-l), modifying the values (-m)\n"\ "and executing commands on the watchdog controller (-c).\n"\

"This utility must be run with super user permissions.\n"\ "OPTIONS\n"\

"

-l list all

the watchdog timer nodes.\n"\

"

Each Timer node is denoted as controller:timer\n"\

"

Example:\n"\

 

 

"

wdadm -l

 

 

- lists all the nodes\n"\

"

wdadm -l

c1:t1 c1:t2

- lists c:t1 and c:t2 nodes\n"\

"

 

c1

- controller name\n"\

"

 

t1

- timer name\n"\

"

-m modify the timeout and action parameters for a timer node.\n"\

"

Example:\n"\

 

 

"

wdadm -m

c1:t1 -t <timeout in ms> -a <action>\n"\

"

wdadm -m

c1:t1 -t <timeout in ms>\n"\

"

wdadm -m

c1:t1 -a <action>\n"\

"

Note: Before using this option, the controller must be\n"\

"

disarmed (using -c option).\n"\

"

-c Execute commands on the watchdog controller node\n"\

"

Commands

supported are : arm, disarm\n"\

"

Example:\n"\

 

 

"

wdadm -c

controller -o arm\n"\

"

arms the

watchdog controller node called controller\n"

#define HEADER

"NAME (controller:timer)\t\tSTATUS"\

 

 

"\t\tACTION\t\tTIMEOUT\n"

#define PRINT_FORMAT

"\t%-10s\t%-10s\t%d"

#define ILLEGAL_TIMEOUT -999

 

/* watchdog properties */

 

 

#define WATCHDOG_ACTION

 

"WdAction"

#define WATCHDOG_TIMEOUT

 

"WdTimeout"

#define WATCHDOG_STATUS

 

"State"

#define WATCHDOG_OP

 

 

"WdOp"

#define PICL_WATCHDOG_CONTROLLER

"watchdog-controller"

6 Netra CP2500 Board Programming Guide • March 2007

Page 20
Image 20
Sun Microsystems CP2500 manual Code Example 1-1System Watchdog Node Management Code Example