EasyManua.ls Logo

Sun Microsystems Netra T2000 - Page 114

Sun Microsystems Netra T2000
122 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
98 Netra T2000 Server Administration Guide September 2006
if (strcmp(alarm, "crit") == 0)
altype = ALARM_CRITICAL;
else
if (strcmp(alarm, "major") == 0)
altype = ALARM_MAJOR;
else
if (strcmp(alarm, "minor") == 0)
altype = ALARM_MINOR;
else
if (strcmp(alarm, "user") == 0)
altype = ALARM_USER;
else {
printf("invalid alarm value: %s\n", alarm);
altype = ALARM_INVALID;
}
return (altype);
}
static int
lom_ioctl(int ioc, char *buf)
{
int fd, ret;
fd = open(LOM_DEVICE, O_RDWR);
if (fd == -1) {
printf("Error opening device: %s\n", LOM_DEVICE);
exit (1);
}
ret = ioctl(fd, ioc, (void *)buf);
close (fd);
return (ret);
}
static char *
get_alarmval(int state)
{
if (state == ALARM_OFF)
return ("off");
else
if (state == ALARM_ON)
CODE EXAMPLE B-1 Example Program to get and set Status of the Alarms (Continued)

Table of Contents

Other manuals for Sun Microsystems Netra T2000

Related product manuals