Herunterladen Inhalt Inhalt Diese Seite drucken

Sun Microsystems Netra T2000 Systemverwaltungshandbuch Seite 126

Vorschau ausblenden Andere Handbücher für Netra T2000:
Inhaltsverzeichnis

Werbung

Beispielprogramm zum Abrufen (get) und Setzen (set) des Alarmstatus (Fortsetzung)
CODE BEISPIEL B-1
int altype;
if (strcmp(alarm, "crit") == 0)
else
if (strcmp(alarm, "major") == 0)
else
if (strcmp(alarm, "minor") == 0)
else
if (strcmp(alarm, "user") == 0)
else {
}
return (altype);
}
static int
lom_ioctl(int ioc, char *buf)
{
int fd, ret;
fd = open(LOM_DEVICE, O_RDWR);
if (fd == -1) {
}
ret = ioctl(fd, ioc, (void *)buf);
close (fd);
return (ret);
}
static char *
get_alarmval(int state)
{
if (state == ALARM_OFF)
else
108
Netra T2000-Server - Systemverwaltungshandbuch • September 2006
altype = ALARM_CRITICAL;
altype = ALARM_MAJOR;
altype = ALARM_MINOR;
altype = ALARM_USER;
printf("invalid alarm value: %s\n", alarm);
altype = ALARM_INVALID;
printf("Error opening device: %s\n", LOM_DEVICE);
exit(1);
return ("off");

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis