rpms/cpqarrayd/devel cpqarrayd-2.3.no_ida.patch, NONE, 1.1 cpqarrayd-2.3.sysVinit.patch, NONE, 1.1 cpqarrayd.spec, NONE, 1.1 import.log, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
David Juran (djuran)
fedora-extras-commits at redhat.com
Fri Jul 18 08:22:06 UTC 2008
Author: djuran
Update of /cvs/pkgs/rpms/cpqarrayd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10439/devel
Modified Files:
.cvsignore sources
Added Files:
cpqarrayd-2.3.no_ida.patch cpqarrayd-2.3.sysVinit.patch
cpqarrayd.spec import.log
Log Message:
initial import
cpqarrayd-2.3.no_ida.patch:
--- NEW FILE cpqarrayd-2.3.no_ida.patch ---
diff -up cpqarrayd-2.3/configure.ac.orig cpqarrayd-2.3/configure.ac
--- cpqarrayd-2.3/configure.ac.orig 2008-07-09 15:00:42.000000000 +0300
+++ cpqarrayd-2.3/configure.ac 2008-07-09 15:02:58.000000000 +0300
@@ -16,35 +16,35 @@ AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])
-dnl Check for pathed kernel sources with ida_ioctl.h
-AC_MSG_CHECKING(for kernel sources)
-found_kernel_dir=""
-for kernel_dir in /usr/src/linux /usr/src/linux-2.4
-do
- if test -d $kernel_dir ; then
- CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
- CPPFLAGS="$CPPFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
- found_kernel_dir="$kernel_dir"
- fi
-done
-
-if test "$found_kernel_dir" != "" ; then
- AC_MSG_RESULT(found $found_kernel_dir )
-else
- AC_MSG_ERROR(Kernel sources not found)
-fi
+dnl dnl Check for pathed kernel sources with ida_ioctl.h
+dnl AC_MSG_CHECKING(for kernel sources)
+dnl found_kernel_dir=""
+dnl for kernel_dir in /usr/src/linux /usr/src/linux-2.4
+dnl do
+dnl if test -d $kernel_dir ; then
+dnl CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
+dnl CPPFLAGS="$CPPFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
+dnl found_kernel_dir="$kernel_dir"
+dnl fi
+dnl done
+
+dnl if test "$found_kernel_dir" != "" ; then
+dnl AC_MSG_RESULT(found $found_kernel_dir )
+dnl else
+dnl AC_MSG_ERROR(Kernel sources not found)
+dnl fi
dnl Check for compile.h (2.6.x kernels only?
AC_CHECK_HEADERS(linux/compiler.h)
-dnl Check Headers
-AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,,
- AC_MSG_ERROR(You need to have the SmartArray driver in the kernel.))
-
-dnl Check version of SmartArray driver
-AC_MSG_CHECKING(SmartArray driver version)
-AC_EGREP_HEADER(blk_cnt, ida_ioctl.h,AC_MSG_RESULT(ok),
- AC_MSG_ERROR(You need to have the SmartArray driver version 1.0.1 or higher installed.))
+dnl dnl Check Headers
+dnl AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,,
+dnl AC_MSG_ERROR(You need to have the SmartArray driver in the kernel.))
+
+dnl dnl Check version of SmartArray driver
+dnl AC_MSG_CHECKING(SmartArray driver version)
+dnl AC_EGREP_HEADER(blk_cnt, ida_ioctl.h,AC_MSG_RESULT(ok),
+dnl AC_MSG_ERROR(You need to have the SmartArray driver version 1.0.1 or higher installed.))
dnl Check for CCISS header file
AC_CHECK_HEADERS(linux/cciss_ioctl.h,,
diff -up cpqarrayd-2.3/cpqarrayd.c.orig cpqarrayd-2.3/cpqarrayd.c
--- cpqarrayd-2.3/cpqarrayd.c.orig 2008-07-09 15:03:52.000000000 +0300
+++ cpqarrayd-2.3/cpqarrayd.c 2008-07-09 15:22:19.000000000 +0300
@@ -35,9 +35,9 @@
#include <linux/compiler.h>
#endif
-#if defined(__linux__)
- #include <ida_ioctl.h>
-#endif
+/* #if defined(__linux__) */
+/* #include <ida_ioctl.h> */
+/* #endif */
#if defined(__freebsd__)
#include <idavar.h>
@@ -249,7 +249,7 @@ int main(int argc, char *argv[])
syslog(LOG_INFO, "Logging Enabled...");
while (keeprunning) {
- status_check(opts);
+/* status_check(opts); */
cciss_status_check(opts);
if (keeprunning) { sleep(30); }
}
diff -up cpqarrayd-2.3/discover.c.orig cpqarrayd-2.3/discover.c
--- cpqarrayd-2.3/discover.c.orig 2008-07-09 15:05:25.000000000 +0300
+++ cpqarrayd-2.3/discover.c 2008-07-09 15:12:43.000000000 +0300
@@ -33,12 +33,12 @@
#include <linux/compiler.h>
#endif
-#if defined(__linux__)
- #include <ida_ioctl.h>
- #include <ida_ioctl.h>
- #include <ida_cmd.h>
- #include <cpqarray.h>
-#endif
+/* #if defined(__linux__) */
+/* #include <ida_ioctl.h> */
+/* #include <ida_ioctl.h> */
+/* #include <ida_cmd.h> */
+/* #include <cpqarray.h> */
+/* #endif */
#if defined(__freebsd__)
#include <idavar.h>
@@ -52,8 +52,8 @@
int discover_controllers (struct opts);
-int interrogate_controller (struct opts, const char *);
-int interrogate_logical(struct opts, int, int);
+/* int interrogate_controller (struct opts, const char *); */
+/* int interrogate_logical(struct opts, int, int); */
void boardid2str (unsigned long , char *);
/* Added devfs devices
@@ -84,26 +84,26 @@ discover_controllers (struct opts opts)
int cntr;
int foundone = 0;
- for (cntr = 0; cntr < 8; cntr++)
- {
- /* does this device exist ? */
- if ((access (controllers[cntr], R_OK | F_OK)) == 0)
- {
- /* it does :) */
- if (interrogate_controller (opts, controllers[cntr]))
- {
- foundone = 1;
- if (opts.debug)
- fprintf (stderr, "DEBUG: %s is a existing controller\n",
- controllers[cntr]);
- }
- }
- else if (opts.debug)
- {
- fprintf (stderr, "DEBUG: Device %s could not be opened\n", controllers[cntr]);
- perror ("DEBUG: reason");
- }
- }
+/* for (cntr = 0; cntr < 8; cntr++) */
+/* { */
+/* /\* does this device exist ? *\/ */
+/* if ((access (controllers[cntr], R_OK | F_OK)) == 0) */
+/* { */
+/* /\* it does :) *\/ */
+/* if (interrogate_controller (opts, controllers[cntr])) */
+/* { */
+/* foundone = 1; */
+/* if (opts.debug) */
+/* fprintf (stderr, "DEBUG: %s is a existing controller\n", */
+/* controllers[cntr]); */
+/* } */
+/* } */
+/* else if (opts.debug) */
+/* { */
+/* fprintf (stderr, "DEBUG: Device %s could not be opened\n", controllers[cntr]); */
+/* perror ("DEBUG: reason"); */
+/* } */
+/* } */
for (cntr = 0; cntr < 16; cntr++)
{
/* does this device exist ? */
@@ -127,106 +127,106 @@ discover_controllers (struct opts opts)
return foundone;
}
-int
-interrogate_controller (struct opts opts, const char *devicefile)
-{
- int devicefd;
- ida_ioctl_t io;
- char buffer[30];
- int foundone = 0;
- int cntr;
+/* int */
+/* interrogate_controller (struct opts opts, const char *devicefile) */
+/* { */
+/* int devicefd; */
+/* ida_ioctl_t io; */
+/* char buffer[30]; */
+/* int foundone = 0; */
+/* int cntr; */
- devicefd = open (devicefile, O_RDONLY);
- /* no checks, did that before */
+/* devicefd = open (devicefile, O_RDONLY); */
+/* /\* no checks, did that before *\/ */
- /* clear io */
- memset (&io, 0, sizeof (io));
+/* /\* clear io *\/ */
+/* memset (&io, 0, sizeof (io)); */
- io.cmd = ID_CTLR;
+/* io.cmd = ID_CTLR; */
- if (ioctl (devicefd, IDAPASSTHRU, &io) < 0)
- {
- if (opts.debug) perror ("DEBUG: ioctl");
- return 0;
- }
+/* if (ioctl (devicefd, IDAPASSTHRU, &io) < 0) */
+/* { */
+/* if (opts.debug) perror ("DEBUG: ioctl"); */
+/* return 0; */
+/* } */
- boardid2str (io.c.id_ctlr.board_id, buffer);
+/* boardid2str (io.c.id_ctlr.board_id, buffer); */
- ctrls_found[ctrls_found_num].ctrl_devicename = (char *)malloc(strlen(buffer)+1);
- strncpy (ctrls_found[ctrls_found_num].ctrl_devicename,
- buffer, strlen(buffer)+1);
+/* ctrls_found[ctrls_found_num].ctrl_devicename = (char *)malloc(strlen(buffer)+1); */
+/* strncpy (ctrls_found[ctrls_found_num].ctrl_devicename, */
+/* buffer, strlen(buffer)+1); */
- ctrls_found[ctrls_found_num].ctrl_type = CTRLTYPE_IDA;
+/* ctrls_found[ctrls_found_num].ctrl_type = CTRLTYPE_IDA; */
- ctrls_found[ctrls_found_num].num_logd_found = 0;
+/* ctrls_found[ctrls_found_num].num_logd_found = 0; */
- for (cntr = 0; cntr < io.c.id_ctlr.nr_drvs; cntr++)
- {
- if (interrogate_logical (opts, devicefd, cntr))
- {
- foundone = 1;
- }
- }
+/* for (cntr = 0; cntr < io.c.id_ctlr.nr_drvs; cntr++) */
+/* { */
+/* if (interrogate_logical (opts, devicefd, cntr)) */
+/* { */
+/* foundone = 1; */
+/* } */
+/* } */
- if (opts.verbose) printf(" Found a %s (%d Logical drives)\n", buffer,
- ctrls_found[ctrls_found_num].num_logd_found);
+/* if (opts.verbose) printf(" Found a %s (%d Logical drives)\n", buffer, */
+/* ctrls_found[ctrls_found_num].num_logd_found); */
- ctrls_found[ctrls_found_num].devicefile = (char *)malloc(strlen(devicefile)+1);
- strcpy(ctrls_found[ctrls_found_num].devicefile, devicefile);
+/* ctrls_found[ctrls_found_num].devicefile = (char *)malloc(strlen(devicefile)+1); */
+/* strcpy(ctrls_found[ctrls_found_num].devicefile, devicefile); */
- close (devicefd);
+/* close (devicefd); */
- ctrls_found_num++;
+/* ctrls_found_num++; */
- return 1;
-}
+/* return 1; */
+/* } */
-int
-interrogate_logical (struct opts opts, int devicefd, int unit_nr)
-{
- ida_ioctl_t io;
- ida_ioctl_t io2;
- int nr_blks, blks_tr;
+/* int */
+/* interrogate_logical (struct opts opts, int devicefd, int unit_nr) */
+/* { */
+/* ida_ioctl_t io; */
+/* ida_ioctl_t io2; */
+/* int nr_blks, blks_tr; */
- if (opts.debug) printf ("DEBUG: interrogating unit %d\n", unit_nr);
+/* if (opts.debug) printf ("DEBUG: interrogating unit %d\n", unit_nr); */
- memset (&io, 0, sizeof (io));
+/* memset (&io, 0, sizeof (io)); */
- io.cmd = ID_LOG_DRV;
- io.unit = unit_nr | UNITVALID;
+/* io.cmd = ID_LOG_DRV; */
+/* io.unit = unit_nr | UNITVALID; */
- if (ioctl (devicefd, IDAPASSTHRU, &io) < 0)
- {
- perror ("FATAL: ID_LOG_DRV ioctl");
- return 0;
- }
+/* if (ioctl (devicefd, IDAPASSTHRU, &io) < 0) */
+/* { */
+/* perror ("FATAL: ID_LOG_DRV ioctl"); */
+/* return 0; */
+/* } */
- memset (&io2, 0, sizeof (io2));
+/* memset (&io2, 0, sizeof (io2)); */
- io2.cmd = SENSE_LOG_DRV_STAT;
- io2.unit = unit_nr | UNITVALID;
+/* io2.cmd = SENSE_LOG_DRV_STAT; */
+/* io2.unit = unit_nr | UNITVALID; */
- if (ioctl (devicefd, IDAPASSTHRU, &io2) < 0)
- {
- perror ("FATAL: SENSE_LOG_DRV_STAT ioctl");
- return 0;
- }
+/* if (ioctl (devicefd, IDAPASSTHRU, &io2) < 0) */
+/* { */
+/* perror ("FATAL: SENSE_LOG_DRV_STAT ioctl"); */
+/* return 0; */
+/* } */
- ctrls_found[ctrls_found_num].num_logd_found++;
- /* ctrls_found[ctrls_found_num].log_disk[unit_nr].status =
- * io2.c.sense_log_drv_stat.status;
-
- * nr_blks = io2.c.id_log_drv.nr_blks;
- * blks_tr = io.c.sense_log_drv_stat.blks_to_recover;
- * ctrls_found[ctrls_found_num].log_disk[unit_nr].pvalue =
- * ((float)(nr_blks - blks_tr)/(float)nr_blks) * 100;
- */
- ctrls_found[ctrls_found_num].log_disk[unit_nr].status = 0;
- ctrls_found[ctrls_found_num].log_disk[unit_nr].pvalue = 0;
+/* ctrls_found[ctrls_found_num].num_logd_found++; */
+/* /\* ctrls_found[ctrls_found_num].log_disk[unit_nr].status = */
+/* * io2.c.sense_log_drv_stat.status; */
+
+/* * nr_blks = io2.c.id_log_drv.nr_blks; */
+/* * blks_tr = io.c.sense_log_drv_stat.blks_to_recover; */
+/* * ctrls_found[ctrls_found_num].log_disk[unit_nr].pvalue = */
+/* * ((float)(nr_blks - blks_tr)/(float)nr_blks) * 100; */
+/* *\/ */
+/* ctrls_found[ctrls_found_num].log_disk[unit_nr].status = 0; */
+/* ctrls_found[ctrls_found_num].log_disk[unit_nr].pvalue = 0; */
- return 1;
-}
+/* return 1; */
+/* } */
void
boardid2str (unsigned long board_id, char *name)
diff -up cpqarrayd-2.3/status.c.orig cpqarrayd-2.3/status.c
--- cpqarrayd-2.3/status.c.orig 2008-07-09 15:16:05.000000000 +0300
+++ cpqarrayd-2.3/status.c 2008-07-09 15:20:51.000000000 +0300
@@ -33,9 +33,9 @@
#endif
#include <sys/ioctl.h>
-#include <ida_ioctl.h>
-#include <ida_cmd.h>
-#include <cpqarray.h>
+/* #include <ida_ioctl.h> */
+/* #include <ida_cmd.h> */
+/* #include <cpqarray.h> */
#include <syslog.h>
#include "cpqarrayd.h"
@@ -45,144 +45,144 @@
#include "cciss_structs.h"
#include "cciss_functions.h"
-int status_check (struct opts opts)
-{
+/* int status_check (struct opts opts) */
+/* { */
- int devicefd;
- int ctrl_cntr;
- int logd_cntr;
- ida_ioctl_t io, io2;
- int status, nr_blks, blks_tr, trap_stat;
- float pvalue;
- char statusmsg[1024];
- int counter;
+/* int devicefd; */
+/* int ctrl_cntr; */
+/* int logd_cntr; */
+/* ida_ioctl_t io, io2; */
+/* int status, nr_blks, blks_tr, trap_stat; */
+/* float pvalue; */
+/* char statusmsg[1024]; */
+/* int counter; */
- for ( ctrl_cntr=0;
- ctrl_cntr < ctrls_found_num;
- ctrl_cntr++) {
- if (ctrls_found[ctrl_cntr].ctrl_type != CTRLTYPE_IDA) {
- break;
- }
+/* for ( ctrl_cntr=0; */
+/* ctrl_cntr < ctrls_found_num; */
+/* ctrl_cntr++) { */
+/* if (ctrls_found[ctrl_cntr].ctrl_type != CTRLTYPE_IDA) { */
+/* break; */
+/* } */
- devicefd = open (ctrls_found[ctrl_cntr].devicefile, O_RDONLY);
+/* devicefd = open (ctrls_found[ctrl_cntr].devicefile, O_RDONLY); */
- for ( logd_cntr=0;
- logd_cntr < ctrls_found[ctrl_cntr].num_logd_found;
- logd_cntr++) {
+/* for ( logd_cntr=0; */
+/* logd_cntr < ctrls_found[ctrl_cntr].num_logd_found; */
+/* logd_cntr++) { */
- memset (&io, 0, sizeof (io));
+/* memset (&io, 0, sizeof (io)); */
- io.cmd = SENSE_LOG_DRV_STAT;
- io.unit = logd_cntr | UNITVALID;
+/* io.cmd = SENSE_LOG_DRV_STAT; */
+/* io.unit = logd_cntr | UNITVALID; */
- if (ioctl (devicefd, IDAPASSTHRU, &io) < 0)
- {
- perror ("SENSE_LOG_DRV_STAT ioctl");
- return 0;
- }
+/* if (ioctl (devicefd, IDAPASSTHRU, &io) < 0) */
+/* { */
+/* perror ("SENSE_LOG_DRV_STAT ioctl"); */
+/* return 0; */
+/* } */
- status=io.c.sense_log_drv_stat.status;
+/* status=io.c.sense_log_drv_stat.status; */
- if ((status == 3) || (status == 5) || (status == 7)) {
- /* is a progress indicator required?
- */
- memset (&io2, 0, sizeof (io));
+/* if ((status == 3) || (status == 5) || (status == 7)) { */
+/* /\* is a progress indicator required? */
+/* *\/ */
+/* memset (&io2, 0, sizeof (io)); */
- io2.cmd = ID_LOG_DRV;
- io2.unit = logd_cntr | UNITVALID;
+/* io2.cmd = ID_LOG_DRV; */
+/* io2.unit = logd_cntr | UNITVALID; */
- if (ioctl (devicefd, IDAPASSTHRU, &io2) < 0)
- {
- perror ("ID_LOG_DRV ioctl");
- /* return 0; no return this isn't fatal for now */
- }
- else
- {
- nr_blks = io2.c.id_log_drv.nr_blks;
- blks_tr = io.c.sense_log_drv_stat.blks_to_recover;
+/* if (ioctl (devicefd, IDAPASSTHRU, &io2) < 0) */
+/* { */
+/* perror ("ID_LOG_DRV ioctl"); */
+/* /\* return 0; no return this isn't fatal for now *\/ */
+/* } */
+/* else */
+/* { */
+/* nr_blks = io2.c.id_log_drv.nr_blks; */
+/* blks_tr = io.c.sense_log_drv_stat.blks_to_recover; */
- pvalue = ((float)(nr_blks - blks_tr)/(float)nr_blks) * 100;
+/* pvalue = ((float)(nr_blks - blks_tr)/(float)nr_blks) * 100; */
- }
- }
- else {
- pvalue = 0.0;
- }
-
- if (opts.debug) {
- fprintf(stdout, "DEBUG: Status of controller %d unit %d is %d\n",
- ctrl_cntr, logd_cntr, status);
- fprintf(stdout, "DEBUG: ");
- fprintf(stdout, statusstr[status],
- ctrl_cntr, logd_cntr, pvalue);
- fprintf(stdout, "\n");
- }
+/* } */
+/* } */
+/* else { */
+/* pvalue = 0.0; */
+/* } */
+
+/* if (opts.debug) { */
+/* fprintf(stdout, "DEBUG: Status of controller %d unit %d is %d\n", */
+/* ctrl_cntr, logd_cntr, status); */
+/* fprintf(stdout, "DEBUG: "); */
+/* fprintf(stdout, statusstr[status], */
+/* ctrl_cntr, logd_cntr, pvalue); */
+/* fprintf(stdout, "\n"); */
+/* } */
- if (status != ctrls_found[ctrl_cntr].log_disk[logd_cntr].status) {
- /* status changed, time to send a trap */
- syslog(LOG_WARNING, "/dev/c%dd%d: Status change.", ctrl_cntr,
- logd_cntr);
- syslog(LOG_WARNING, statusstr[status], ctrl_cntr, logd_cntr,
- pvalue);
- if (opts.debug) {
- printf ("DEBUG: status changed from %d to %d, pvalue = %f\n",
- ctrls_found[ctrl_cntr].log_disk[logd_cntr].status, status,
- pvalue);
- }
- sprintf(statusmsg, statusstr[status], ctrl_cntr, logd_cntr, pvalue);
- if (opts.debug) {
- printf("DEBUG: sending traps.\n");
- }
- /* Send a trap, syslog if send_trap returns !0. */
- if (trap_stat = sendtrap(opts, "beheer", status, statusmsg)) {
- syslog(LOG_WARNING,
- "problem sending snmp trap (sendtrap() returned %d)\n",
- trap_stat);
- if (opts.debug) {
- printf("DEBUG: Problem sending snmp trap",
- "(sendtrap() returned %d)\n",
- trap_stat);
- }
- }
- }
- else if ((status == 5) &&
- ((pvalue - ctrls_found[ctrl_cntr].log_disk[logd_cntr].pvalue)
- >= 25.0 )) {
- /* pvalue changed by more than 25%, time to send a trap */
- syslog(LOG_WARNING, "/dev/c%dd%d: Percentile value change.",
- ctrl_cntr, logd_cntr);
- syslog(LOG_WARNING, statusstr[status], ctrl_cntr, logd_cntr,
- pvalue);
- if (opts.debug) {
- printf ("DEBUG: pvalue changed from %f to %f\n",
- ctrls_found[ctrl_cntr].log_disk[logd_cntr].pvalue,
- pvalue);
- }
- sprintf(statusmsg, statusstr[status], ctrl_cntr, logd_cntr, pvalue);
- if (opts.debug) {
- printf("DEBUG: sending traps.\n");
- }
- if (trap_stat = sendtrap(opts, "beheer", status, statusmsg)) {
- syslog(LOG_WARNING,
- "problem sending snmp trap (sendtrap() returned %d)\n",
- trap_stat);
- if (opts.debug) {
- printf("DEBUG: Problem sending snmp trap ",
- "(sendtrap() returned %d)\n",
- trap_stat);
- }
- }
- ctrls_found[ctrl_cntr].log_disk[logd_cntr].pvalue = pvalue;
- }
- ctrls_found[ctrl_cntr].log_disk[logd_cntr].status = status;
- }
- close (devicefd);
- }
+/* if (status != ctrls_found[ctrl_cntr].log_disk[logd_cntr].status) { */
+/* /\* status changed, time to send a trap *\/ */
+/* syslog(LOG_WARNING, "/dev/c%dd%d: Status change.", ctrl_cntr, */
+/* logd_cntr); */
+/* syslog(LOG_WARNING, statusstr[status], ctrl_cntr, logd_cntr, */
+/* pvalue); */
+/* if (opts.debug) { */
+/* printf ("DEBUG: status changed from %d to %d, pvalue = %f\n", */
+/* ctrls_found[ctrl_cntr].log_disk[logd_cntr].status, status, */
+/* pvalue); */
+/* } */
+/* sprintf(statusmsg, statusstr[status], ctrl_cntr, logd_cntr, pvalue); */
+/* if (opts.debug) { */
+/* printf("DEBUG: sending traps.\n"); */
+/* } */
+/* /\* Send a trap, syslog if send_trap returns !0. *\/ */
+/* if (trap_stat = sendtrap(opts, "beheer", status, statusmsg)) { */
+/* syslog(LOG_WARNING, */
+/* "problem sending snmp trap (sendtrap() returned %d)\n", */
+/* trap_stat); */
+/* if (opts.debug) { */
+/* printf("DEBUG: Problem sending snmp trap", */
+/* "(sendtrap() returned %d)\n", */
+/* trap_stat); */
+/* } */
+/* } */
+/* } */
+/* else if ((status == 5) && */
+/* ((pvalue - ctrls_found[ctrl_cntr].log_disk[logd_cntr].pvalue) */
+/* >= 25.0 )) { */
+/* /\* pvalue changed by more than 25%, time to send a trap *\/ */
+/* syslog(LOG_WARNING, "/dev/c%dd%d: Percentile value change.", */
+/* ctrl_cntr, logd_cntr); */
+/* syslog(LOG_WARNING, statusstr[status], ctrl_cntr, logd_cntr, */
+/* pvalue); */
+/* if (opts.debug) { */
+/* printf ("DEBUG: pvalue changed from %f to %f\n", */
+/* ctrls_found[ctrl_cntr].log_disk[logd_cntr].pvalue, */
+/* pvalue); */
+/* } */
+/* sprintf(statusmsg, statusstr[status], ctrl_cntr, logd_cntr, pvalue); */
+/* if (opts.debug) { */
+/* printf("DEBUG: sending traps.\n"); */
+/* } */
+/* if (trap_stat = sendtrap(opts, "beheer", status, statusmsg)) { */
+/* syslog(LOG_WARNING, */
+/* "problem sending snmp trap (sendtrap() returned %d)\n", */
+/* trap_stat); */
+/* if (opts.debug) { */
+/* printf("DEBUG: Problem sending snmp trap ", */
+/* "(sendtrap() returned %d)\n", */
+/* trap_stat); */
+/* } */
+/* } */
+/* ctrls_found[ctrl_cntr].log_disk[logd_cntr].pvalue = pvalue; */
+/* } */
+/* ctrls_found[ctrl_cntr].log_disk[logd_cntr].status = status; */
+/* } */
+/* close (devicefd); */
+/* } */
- return 1;
+/* return 1; */
-}
+/* } */
int cciss_status_check (struct opts opts)
{
@@ -190,7 +190,7 @@ int cciss_status_check (struct opts opts
int devicefd;
int ctrl_cntr, result;
int logd_cntr;
- ida_ioctl_t io, io2;
+/* ida_ioctl_t io, io2; */
int status, nr_blks, blks_tr, trap_stat;
float pvalue;
char statusmsg[1024];
cpqarrayd-2.3.sysVinit.patch:
--- NEW FILE cpqarrayd-2.3.sysVinit.patch ---
diff -up cpqarrayd-2.3/scripts/cpqarrayd.orig cpqarrayd-2.3/scripts/cpqarrayd
--- cpqarrayd-2.3/scripts/cpqarrayd.orig 2008-07-09 17:55:59.000000000 +0300
+++ cpqarrayd-2.3/scripts/cpqarrayd 2008-07-14 16:43:49.000000000 +0300
@@ -2,7 +2,7 @@
#
# cpqarrayd Start/Stop Compaq Array monitor
#
-# chkconfig: 345 15 90
+# chkconfig: - 51 90
# description: The cpqarrayd monitors the status of Compaq Raid Arrays, \
# and reports via syslog or traps
# processname: cpqarrayd
@@ -23,8 +23,9 @@ RETVAL=0
case "$1" in
start)
echo -n "Starting cpqarrayd: "
- daemon /usr/sbin/cpqarrayd $CPQ_PARAMS
- RETVAL=$?
+# daemon /usr/sbin/cpqarrayd $CPQ_PARAMS |grep -v ^DEBUG:
+ { daemon /usr/sbin/cpqarrayd $CPQ_PARAMS
+ RETVAL=$?; } |grep -v ^DEBUG:
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/cpqarrayd
;;
@@ -39,13 +40,22 @@ case "$1" in
status cpqarrayd
RETVAL=$?
;;
- restart|reload)
+ restart|force-reload)
$0 stop
$0 start
RETVAL=$?
;;
- *)
- echo "Usage: cpqarrayd {start|stop|status|restart|reload}"
+ reload)
+ exit 3
+ ;;
+ condrestart|try-restart)
+ if status cpqarrayd > /dev/null; then
+ $0 stop
+ $0 start
+ fi
+ ;;
+ *)
+ echo "Usage: cpqarrayd {start|stop|status|restart|force-reolad|reload|cond-restart|try-restart}"
exit 1
esac
--- NEW FILE cpqarrayd.spec ---
Name: cpqarrayd
Version: 2.3
Release: 3%{?dist}
Summary: Cpqarrayd is a daemon to monitor HP (compaq) arraycontrollers
Group: System Environment/Base
License: GPLv2+
URL: http://www.strocamp.net/opensource/cpqarrayd.php
Source0: http://www.strocamp.net/opensource/compaq/downloads/cpqarrayd-2.3.tar.gz
Patch0: cpqarrayd-2.3.no_ida.patch
Patch1: cpqarrayd-2.3.sysVinit.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf, automake
BuildRequires: net-snmp-devel
Requires(post): chkconfig
Requires(postun): initscripts
Requires(preun): chkconfig
Requires(preun): initscripts
%description
Cpqarrayd is a daemon to monitor HP (compaq) arraycontrollers. It reports any
status changes, like failing disks, to the syslog and optionally to a remote
host using SNMP traps. Note that support for the old(?) IDA Arrays have been
disabled in this package due to build issues and lack of testing hardware.
%prep
%setup -q
%patch0 -p1 -b .no_ida
%patch1 -p1 -b .sysVinit
%build
autoreconf -si
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
cp scripts/cpqarrayd $RPM_BUILD_ROOT/%{_initrddir}
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
cp scripts/cpqarrayd.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/cpqarrayd
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add cpqarrayd
%preun
if [ $1 = 0 ] ; then
/sbin/service cpqarrayd stop >/dev/null 2>&1
/sbin/chkconfig --del cpqarrayd
fi
%postun
if [ "$1" -ge "1" ] ; then
/sbin/service cpqarrayd condrestart >/dev/null 2>&1 || :
fi
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog DEVEL NEWS README
%_sbindir/cpqarrayd
%config(noreplace) %_sysconfdir/sysconfig/cpqarrayd
%_initrddir/cpqarrayd
%doc %_mandir/man1/cpqarrayd*
%changelog
* Thu Jul 17 2008 <djuran at redhat.com> - 2.3-3
- fix rpmlint warnings
* Mon Jul 14 2008 <djuran at redhat.com> - 2.3-2
- Make SysVinit script compliant with Fedora Packaging Guidelines
* Wed Jul 9 2008 <djuran at redhat.com> - 2.3-1
- Initial packaging
--- NEW FILE import.log ---
cpqarrayd-2_3-3_fc9:HEAD:cpqarrayd-2.3-3.fc9.src.rpm:1216369152
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/cpqarrayd/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 17 Jul 2008 18:33:19 -0000 1.1
+++ .cvsignore 18 Jul 2008 08:21:21 -0000 1.2
@@ -0,0 +1 @@
+cpqarrayd-2.3.tar.gz
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/cpqarrayd/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 17 Jul 2008 18:33:19 -0000 1.1
+++ sources 18 Jul 2008 08:21:21 -0000 1.2
@@ -0,0 +1 @@
+55421afe4817863efab45c59a9486a60 cpqarrayd-2.3.tar.gz
More information about the scm-commits
mailing list