diff options
Diffstat (limited to 'scripts')
64 files changed, 2376 insertions, 0 deletions
diff --git a/scripts/Makefile b/scripts/Makefile new file mode 100644 index 0000000..53fd363 --- /dev/null +++ b/scripts/Makefile @@ -0,0 +1,381 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# scripts/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +srcdir = . +top_srcdir = .. + +pkgdatadir = $(datadir)/ipmiutil +pkglibdir = $(libdir)/ipmiutil +pkgincludedir = $(includedir)/ipmiutil +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = /usr/bin/install -c +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-redhat-linux-gnu +host_triplet = x86_64-redhat-linux-gnu +subdir = scripts +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /usr/dev/ipmiutil-2.9.3/missing --run aclocal-1.9 +AMDEP_FALSE = # +AMDEP_TRUE = +AMTAR = ${SHELL} /usr/dev/ipmiutil-2.9.3/missing --run tar +AR = ar +AUTOCONF = ${SHELL} /usr/dev/ipmiutil-2.9.3/missing --run autoconf +AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-2.9.3/missing --run autoheader +AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-2.9.3/missing --run automake-1.9 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CROSS_CFLAGS = +CROSS_LFLAGS = +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +ECHO = echo +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = grep -E +EXEEXT = +F77 = f95 +FFLAGS = -g -O2 +GPL_CFLAGS = +IA64_CFLAGS = +INIT_DIR = /etc//rc.d/init.d +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s +INS_LIB = +LANDESK_CFLAGS = +LANDESK_LDADD = +LANPLUS_CFLAGS = -DHAVE_LANPLUS +LANPLUS_CRYPTO = -lcrypto +LANPLUS_LDADD = -L../lib -lipmi_lanplus -L/usr/local/lib -lcrypto +LANPLUS_LIB = ../lib/libipmi_lanplus.a +LANPLUS_SAM = yes +LDFLAGS = +LD_SAMX = ../lib/libipmi_lanplus.a -lcrypto +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIB_DIR = /usr/lib64 +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /usr/dev/ipmiutil-2.9.3/missing --run makeinfo +OBJEXT = o +OS_CFLAGS = -DLINUX -fPIC -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 +OS_DRIVERS = imbapi.c ipmimv.c ipmild.c ipmidir.c +OS_LFLAGS = +PACKAGE = ipmiutil +PACKAGE_BUGREPORT = +PACKAGE_NAME = +PACKAGE_STRING = +PACKAGE_TARNAME = +PACKAGE_VERSION = +PATH_SEPARATOR = : +PKG_DIR = /usr/src/redhat +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/sh +SHR_LINK = libipmiutil.so +STRIP = strip +SUBDIR_S = doc scripts lib util +SYSTEMD_DIR = /usr/share/ipmiutil +VERSION = 2.9.3 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_F77 = f95 +ac_ct_RANLIB = ranlib +ac_ct_STRIP = strip +am__fastdepCC_FALSE = # +am__fastdepCC_TRUE = +am__fastdepCXX_FALSE = # +am__fastdepCXX_TRUE = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = x86_64-redhat-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = redhat +datadir = ${prefix}/share +exec_prefix = ${prefix} +host = x86_64-redhat-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = redhat +includedir = ${prefix}/include +infodir = ${prefix}/info +install_sh = /usr/dev/ipmiutil-2.9.3/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localstatedir = ${prefix}/var +mandir = ${prefix}/share/man +mkdir_p = mkdir -p -- +oldincludedir = /usr/include +prefix = /usr +program_transform_name = s,x,x, +sbindir = ${prefix}/sbin +sharedstatedir = ${prefix}/com +sysconfdir = ${prefix}/etc +target_alias = + +#!/bin/sh +# Makefile to build/install script files +# +MKDIR = sh ../mkinstalldirs +INSTALL_SH = sh ../install-sh -c +INSTALL_DATA_SH = ${INSTALL_SH} -m 644 +INSTALL_SCRIPT_SH = ${INSTALL_SH} -m 755 +docdir = ${prefix}/share/doc/ipmiutil-${version} +etcdir = /etc +datato = ${DESTDIR}${datadir}/ipmiutil +cronto = ${DESTDIR}${etcdir}/cron.daily +sbinto = ${DESTDIR}${sbindir} +varto = ${DESTDIR}/var/lib/ipmiutil +initto = ${DESTDIR}/etc//rc.d/init.d +sysdto = ${DESTDIR}/usr/share/ipmiutil +sysvinit = ${datato} +sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign scripts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + + +all: + +clean: + +clobber: + +distclean: + +check: + +install: + $(MKDIR) ${datato} + $(MKDIR) ${sbinto} + $(MKDIR) ${initto} + $(MKDIR) ${varto} + $(MKDIR) ${sysdto} + ${INSTALL_SCRIPT_SH} ipmi_if.sh ${datato} + ${INSTALL_SCRIPT_SH} evt.sh ${datato} + if [ -f /etc/debian_version ]; then \ + sysvinit=${initto}; fi + ${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt + ${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy + ${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt + ${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port + ${INSTALL_SCRIPT_SH} ipmi_info ${sysvinit}/ipmi_info + ${INSTALL_SCRIPT_SH} checksel ${datato} + ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto} + ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto} + ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto} + ${INSTALL_DATA_SH} ipmi_port.service ${sysdto} + ${INSTALL_SCRIPT_SH} ipmiutil.env ${datato} + ${INSTALL_SCRIPT_SH} ipmiutil.pre ${datato} + ${INSTALL_SCRIPT_SH} ipmiutil.setup ${datato} + ${INSTALL_SCRIPT_SH} ipmi.init.basic ${datato} + for f in ${sbinfls}; do \ + ${INSTALL_SCRIPT_SH} $$f ${sbinto}; done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..b693a58 --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,60 @@ +#!/bin/sh +# Makefile to build/install script files +# +MKDIR = sh ../mkinstalldirs +INSTALL_SH = sh ../install-sh -c +INSTALL_DATA_SH = ${INSTALL_SH} -m 644 +INSTALL_SCRIPT_SH = ${INSTALL_SH} -m 755 +prefix = /usr + +datadir = ${prefix}/share +mandir = ${prefix}/share/man +docdir = ${prefix}/share/doc/ipmiutil-${version} +sbindir = ${prefix}/sbin +etcdir = /etc +datato = ${DESTDIR}${datadir}/ipmiutil +cronto = ${DESTDIR}${etcdir}/cron.daily +sbinto = ${DESTDIR}${sbindir} +varto = ${DESTDIR}/var/lib/ipmiutil +initto = ${DESTDIR}@INIT_DIR@ +sysdto = ${DESTDIR}@SYSTEMD_DIR@ +sysvinit = ${datato} +sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm + +all: + +clean: + +clobber: + +distclean: + +check: + +install: + $(MKDIR) ${datato} + $(MKDIR) ${sbinto} + $(MKDIR) ${initto} + $(MKDIR) ${varto} + $(MKDIR) ${sysdto} + ${INSTALL_SCRIPT_SH} ipmi_if.sh ${datato} + ${INSTALL_SCRIPT_SH} evt.sh ${datato} + if [ -f /etc/debian_version ]; then \ + sysvinit=${initto}; fi + ${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt + ${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy + ${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt + ${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port + ${INSTALL_SCRIPT_SH} ipmi_info ${sysvinit}/ipmi_info + ${INSTALL_SCRIPT_SH} checksel ${datato} + ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto} + ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto} + ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto} + ${INSTALL_DATA_SH} ipmi_port.service ${sysdto} + ${INSTALL_SCRIPT_SH} ipmiutil.env ${datato} + ${INSTALL_SCRIPT_SH} ipmiutil.pre ${datato} + ${INSTALL_SCRIPT_SH} ipmiutil.setup ${datato} + ${INSTALL_SCRIPT_SH} ipmi.init.basic ${datato} + for f in ${sbinfls}; do \ + ${INSTALL_SCRIPT_SH} $$f ${sbinto}; done + diff --git a/scripts/Makefile.in b/scripts/Makefile.in new file mode 100644 index 0000000..f8587da --- /dev/null +++ b/scripts/Makefile.in @@ -0,0 +1,381 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = scripts +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_CFLAGS = @CROSS_CFLAGS@ +CROSS_LFLAGS = @CROSS_LFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GPL_CFLAGS = @GPL_CFLAGS@ +IA64_CFLAGS = @IA64_CFLAGS@ +INIT_DIR = @INIT_DIR@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INS_LIB = @INS_LIB@ +LANDESK_CFLAGS = @LANDESK_CFLAGS@ +LANDESK_LDADD = @LANDESK_LDADD@ +LANPLUS_CFLAGS = @LANPLUS_CFLAGS@ +LANPLUS_CRYPTO = @LANPLUS_CRYPTO@ +LANPLUS_LDADD = @LANPLUS_LDADD@ +LANPLUS_LIB = @LANPLUS_LIB@ +LANPLUS_SAM = @LANPLUS_SAM@ +LDFLAGS = @LDFLAGS@ +LD_SAMX = @LD_SAMX@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_DIR = @LIB_DIR@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +OS_CFLAGS = @OS_CFLAGS@ +OS_DRIVERS = @OS_DRIVERS@ +OS_LFLAGS = @OS_LFLAGS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_DIR = @PKG_DIR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SHR_LINK = @SHR_LINK@ +STRIP = @STRIP@ +SUBDIR_S = @SUBDIR_S@ +SYSTEMD_DIR = @SYSTEMD_DIR@ +VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = ${prefix}/share +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = ${prefix}/share/man +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = /usr +program_transform_name = @program_transform_name@ +sbindir = ${prefix}/sbin +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +#!/bin/sh +# Makefile to build/install script files +# +MKDIR = sh ../mkinstalldirs +INSTALL_SH = sh ../install-sh -c +INSTALL_DATA_SH = ${INSTALL_SH} -m 644 +INSTALL_SCRIPT_SH = ${INSTALL_SH} -m 755 +docdir = ${prefix}/share/doc/ipmiutil-${version} +etcdir = /etc +datato = ${DESTDIR}${datadir}/ipmiutil +cronto = ${DESTDIR}${etcdir}/cron.daily +sbinto = ${DESTDIR}${sbindir} +varto = ${DESTDIR}/var/lib/ipmiutil +initto = ${DESTDIR}@INIT_DIR@ +sysdto = ${DESTDIR}@SYSTEMD_DIR@ +sysvinit = ${datato} +sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign scripts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + + +all: + +clean: + +clobber: + +distclean: + +check: + +install: + $(MKDIR) ${datato} + $(MKDIR) ${sbinto} + $(MKDIR) ${initto} + $(MKDIR) ${varto} + $(MKDIR) ${sysdto} + ${INSTALL_SCRIPT_SH} ipmi_if.sh ${datato} + ${INSTALL_SCRIPT_SH} evt.sh ${datato} + if [ -f /etc/debian_version ]; then \ + sysvinit=${initto}; fi + ${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt + ${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy + ${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt + ${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port + ${INSTALL_SCRIPT_SH} ipmi_info ${sysvinit}/ipmi_info + ${INSTALL_SCRIPT_SH} checksel ${datato} + ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto} + ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto} + ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto} + ${INSTALL_DATA_SH} ipmi_port.service ${sysdto} + ${INSTALL_SCRIPT_SH} ipmiutil.env ${datato} + ${INSTALL_SCRIPT_SH} ipmiutil.pre ${datato} + ${INSTALL_SCRIPT_SH} ipmiutil.setup ${datato} + ${INSTALL_SCRIPT_SH} ipmi.init.basic ${datato} + for f in ${sbinfls}; do \ + ${INSTALL_SCRIPT_SH} $$f ${sbinto}; done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/scripts/checksel b/scripts/checksel new file mode 100755 index 0000000..63ea9a9 --- /dev/null +++ b/scripts/checksel @@ -0,0 +1,30 @@ +#!/bin/sh +# +# checksel +# +# This script runs ipmiutil sel, writing any new records to syslog, +# and will then clear the SEL if free space is low. +# +# The IPMI SEL should not normally be cleared, because the history +# of the events is important, but if the IPMI SEL fills up, no new +# events are logged, so saving the previous SEL events and clearing +# the SEL must be done occasionally, as needed. +# +# app=`basename $0` +# pdir=`echo $0 |sed -e "s/$app//"` +pdir=/usr/bin +ddir=/var/lib/ipmiutil +# First check to see if the IPMI SEL is enabled on this system. +# If not, do nothing else. +$pdir/ipmiutil sel -v >/dev/null 2>&1 +if [ $? -eq 0 ]; then + # Write new SEL events to syslog, and check if free space is low + $pdir/ipmiutil sel -w |grep "WARNING: free space" + if [ $? -eq 0 ]; then + today=`date +%y%m%d` + # The old SEL records are in syslog, but save a copy in $ddir also. + $pdir/ipmiutil sel -e >$ddir/ipmisel_${today}.txt + # Clear the IPMI SEL + $pdir/ipmiutil sel -d + fi +fi diff --git a/scripts/checksel.cmd b/scripts/checksel.cmd new file mode 100644 index 0000000..2897b76 --- /dev/null +++ b/scripts/checksel.cmd @@ -0,0 +1,15 @@ +@echo off
+REM checksel.cmd
+REM This at script runs ipmiutil sel, writing any new records to syslog,
+REM and will then clear the SEL if free space is low.
+
+REM Get path from arg 0
+set ipmiutildir=%~d0%~p0
+
+cd %ipmiutildir%
+cmd /c %ipmiutildir%\ipmiutil sel -w | findstr /c:"WARNING: free space"
+if errorlevel 1 goto done
+cmd /c %ipmiutildir%\ipmiutil sel -d
+
+:done
+
diff --git a/scripts/evt.sh b/scripts/evt.sh new file mode 100755 index 0000000..b600481 --- /dev/null +++ b/scripts/evt.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# evt.sh +# A sample script to use via ipmiutil getevt -s -r /path/evt.sh +# +evtdesc=$1 +log=/var/log/ipmi_evt.log + +echo "$0 got IPMI event `date`" >>$log +echo "$evtdesc" >>$log +# Check SEVerity for anything other than INFormational. +echo $evtdesc |grep -v INF >/dev/null 2>&1 +if [ $? -eq 0 ]; then + # Could take various specific actions here, like snmptrap, or other alert. + echo "*** Non-INF IPMI Event requiring attention ***" >>$log + snmpdest=`grep trapsink /etc/snmp/snmpd.conf 2>/dev/null |head -n1` + if [ "x$snmpdest" = "x" ]; then + echo "No SNMP trapsink destination" >>$log + else + snmpipadr=`echo $snmpdest |awk '{ print $2 }'` + community=`echo $snmpdest |awk '{ print $3 }'` + snmphost=`uname -n` + uptim=`cat /proc/uptime |cut -f1 -d' '` + trapoid="enterprises.1" + vboid1=".enterprises.1.1" #trapString + vboid2=".enterprises.1.2" #trapSeverity + sev=`echo $evtdesc |cut -c24-26` + case $sev in + MIN) + tsev=2 + ;; + MAJ) + tsev=3 + ;; + CRT) + tsev=4 + ;; + *) + tsev=1 + ;; + esac + snmptrap -v 1 -c $community $snmpipadr $trapoid $snmphost 6 0 $uptim $vboid1 s "$evtdesc" $vboid2 i $tsev + echo "Send SNMP trap to $snmpipadr for IPMI $sev event, status=$?" >>$log + fi +fi + diff --git a/scripts/ialarms b/scripts/ialarms new file mode 100755 index 0000000..f303bff --- /dev/null +++ b/scripts/ialarms @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil alarms $* diff --git a/scripts/ialarms.cmd b/scripts/ialarms.cmd new file mode 100644 index 0000000..e5e4519 --- /dev/null +++ b/scripts/ialarms.cmd @@ -0,0 +1 @@ +ipmiutil alarms %*
diff --git a/scripts/icmd b/scripts/icmd new file mode 100755 index 0000000..291d6bd --- /dev/null +++ b/scripts/icmd @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil cmd $* diff --git a/scripts/icmd.cmd b/scripts/icmd.cmd new file mode 100644 index 0000000..4cea630 --- /dev/null +++ b/scripts/icmd.cmd @@ -0,0 +1 @@ +ipmiutil cmd %*
diff --git a/scripts/iconfig b/scripts/iconfig new file mode 100755 index 0000000..50ef90a --- /dev/null +++ b/scripts/iconfig @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil config $* diff --git a/scripts/iconfig.cmd b/scripts/iconfig.cmd new file mode 100644 index 0000000..08927fd --- /dev/null +++ b/scripts/iconfig.cmd @@ -0,0 +1 @@ +ipmiutil config %*
diff --git a/scripts/idiscover.cmd b/scripts/idiscover.cmd new file mode 100644 index 0000000..e2d07e5 --- /dev/null +++ b/scripts/idiscover.cmd @@ -0,0 +1 @@ +ipmiutil discover %*
diff --git a/scripts/ifirewall b/scripts/ifirewall new file mode 100755 index 0000000..999176a --- /dev/null +++ b/scripts/ifirewall @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil firewall $* diff --git a/scripts/ifru b/scripts/ifru new file mode 100755 index 0000000..1b0a996 --- /dev/null +++ b/scripts/ifru @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil fru $* diff --git a/scripts/ifru.cmd b/scripts/ifru.cmd new file mode 100644 index 0000000..0c4f048 --- /dev/null +++ b/scripts/ifru.cmd @@ -0,0 +1 @@ +ipmiutil fru %*
diff --git a/scripts/ifwum b/scripts/ifwum new file mode 100755 index 0000000..d4c3272 --- /dev/null +++ b/scripts/ifwum @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil fwum $* diff --git a/scripts/igetevent b/scripts/igetevent new file mode 100755 index 0000000..76b2a25 --- /dev/null +++ b/scripts/igetevent @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil getevt $* diff --git a/scripts/igetevent.cmd b/scripts/igetevent.cmd new file mode 100644 index 0000000..f31d2d0 --- /dev/null +++ b/scripts/igetevent.cmd @@ -0,0 +1 @@ +ipmiutil getevt %*
diff --git a/scripts/ihealth b/scripts/ihealth new file mode 100755 index 0000000..31fcfd7 --- /dev/null +++ b/scripts/ihealth @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil health $* diff --git a/scripts/ihealth.cmd b/scripts/ihealth.cmd new file mode 100644 index 0000000..2dab741 --- /dev/null +++ b/scripts/ihealth.cmd @@ -0,0 +1 @@ +ipmiutil health %*
diff --git a/scripts/ihpm b/scripts/ihpm new file mode 100755 index 0000000..15240b0 --- /dev/null +++ b/scripts/ihpm @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil hpm $* diff --git a/scripts/ilan b/scripts/ilan new file mode 100755 index 0000000..a822176 --- /dev/null +++ b/scripts/ilan @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil lan $* diff --git a/scripts/ilan.cmd b/scripts/ilan.cmd new file mode 100644 index 0000000..68d097e --- /dev/null +++ b/scripts/ilan.cmd @@ -0,0 +1 @@ +ipmiutil lan %*
diff --git a/scripts/init.sh b/scripts/init.sh new file mode 100755 index 0000000..d08fcd6 --- /dev/null +++ b/scripts/init.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# init.sh - run this at install time if rpm postinstall not used +# +sbindir=/usr/bin +vardir=/var/lib/ipmiutil +datadir=/usr/share/ipmiutil +sensorout=$vardir/sensor_out.txt + + if [ -x $datadir/setlib.sh ]; then + $datadir/setlib.sh + fi + + mkdir -p $vardir + if [ ! -f $vardir/ipmi_if.txt ]; then + $datadir/ipmi_if.sh + fi + + # Run some ipmiutil command to see if any IPMI interface works. + $sbindir/ipmiutil wdt >/dev/null 2>&1 + IPMIret=$? + + # If IPMIret==0, the IPMI cmd was successful, and IPMI is enabled locally. + if [ $IPMIret -eq 0 ]; then + # IPMI_IS_ENABLED, so enable services + if [ -x /sbin/chkconfig ]; then + /sbin/chkconfig --add ipmi_port + /sbin/chkconfig --add ipmiutil_wdt + /sbin/chkconfig --add ipmiutil_asy + fi + + # Capture a snapshot of IPMI sensor data once now for later reuse. + if [ ! -f $sensorout ]; then + $sbindir/ipmiutil sensor -q >$sensorout + fi + fi + diff --git a/scripts/install-solaris.sh b/scripts/install-solaris.sh new file mode 100755 index 0000000..b452602 --- /dev/null +++ b/scripts/install-solaris.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Solaris or BSD install.sh +# +datadir=/usr/share/ipmiutil +vardir=/var/lib/ipmiutil +sbindir=/usr/bin +mandir=/usr/share/man/man8 +manfiles="ialarms.8 iconfig.8 ihealth.8 ievents.8 ifru.8 igetevent.8 ireset.8 icmd.8 idiscover.8 ipmiutil.8 isol.8 ilan.8 isensor.8 isel.8 iserial.8 iwdt.8" +shfiles="checksel ipmi_if.sh ipmi_port.sh ipmiutil_wdt" +mibfiles="bmclanpet.mib" + +mkdir -p $datadir +mkdir -p $vardir +mkdir -p $mandir +cp ipmiutil ievents idiscover ipmi_port $sbindir +cp $manfiles $mandir +cp UserGuide $mibfiles $shfiles $datadir +$sbindir/ipmiutil sensor -q >$vardir/sensor_out.txt +# Admin should set up checksel cron script also + diff --git a/scripts/install.cmd b/scripts/install.cmd new file mode 100644 index 0000000..da0e860 --- /dev/null +++ b/scripts/install.cmd @@ -0,0 +1,26 @@ +@echo off
+REM install Windows ipmiutil on this system
+REM install the DLLs, registry entries, and start the checksel task
+REM Use the current directory as the starting path
+set ipmiutildir=%CD%
+set orgdir=%SystemDrive%\Program Files\sourceforge
+set installdir=%orgdir%\ipmiutil
+
+REM DLLs: showsel.dll, libeay32.dll, ssleay32.dll
+copy *.dll %SystemRoot%\system32
+%ipmiutildir%\showsel.reg
+
+echo Copying files to "%installdir%"
+mkdir "%orgdir%"
+mkdir "%installdir%"
+copy "%ipmiutildir%\*.*" "%installdir%"
+
+REM echo PATH=%PATH%
+set PATH=%PATH%;%installdir%
+
+set pathkey="HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
+reg add %pathkey% /v Path /t REG_EXPAND_SZ /d "%PATH%;%installdir%"
+REM reg query %pathkey% /v Path
+
+at 23:30 /every:m,t,w,th,f,s,su "%installdir%\checksel.cmd" >"%installdir%\checksel.id"
+
diff --git a/scripts/install.vbs b/scripts/install.vbs new file mode 100644 index 0000000..e5a1b56 --- /dev/null +++ b/scripts/install.vbs @@ -0,0 +1,47 @@ +' This VBScript should run after all files have been copied onto the system.
+
+Set sh = CreateObject("WScript.Shell")
+Set fso = CreateObject("Scripting.FileSystemObject")
+
+Dim installer : Set installer = Nothing
+Set installer = CreateObject("WindowsInstaller.Installer")
+Dim sOutFile, outs, sScrFile
+
+' Find out where our files were installed
+If(IsEmpty(Session)) Then
+ 'Not running from within installer. Source path is current directory.
+ InstallLoc = sh.CurrentDirectory
+Else
+ 'Running inside the installer, use CustomActionData "[TARGETDIR]".
+ ' InstallLoc = installer.ProductInfo(productCode, "InstallLocation")
+ InstallLoc = Session.Property("CustomActionData")
+ If(IsEmpty(InstallLoc)) Then
+ InstallLoc = "C:\Program Files\sourceforge\ipmiutil"
+ End If
+End If
+' wscript.echo "InstallLoc=" & InstallLoc
+
+' Find System Folder (usually c:\windows\system32).
+key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot"
+SysLoc = sh.RegRead(key) & "\system32"
+
+' Add InstallLoc to the Environment Path
+key3 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path"
+EnvPath = sh.RegRead(key3) & ";" & InstallLoc
+sh.RegWrite key3, EnvPath, "REG_EXPAND_SZ"
+
+' Set up the showsel EventLog source
+' showselmsg.dll is copied by the installer already
+keybase = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel\"
+key1 = keybase & "EventMessageFile"
+key2 = keybase & "TypesSupported"
+sh.RegWrite key1, "%SystemRoot%\system32\showselmsg.dll", "REG_EXPAND_SZ"
+sh.RegWrite key2, 7, "REG_DWORD"
+'val1 = sh.RegRead(key1)
+'val2 = sh.RegRead(key2)
+'wscript.echo "showsel: msgfile " & val1 & " types " & val2
+
+' Schedule the checksel.cmd to run
+sScrFile = InstallLoc & "\checksel.cmd"
+sh.Run "at 23.30 /every:m,t,w,th,f,s,su """ & sScrFile & """ ", 0, True
+
diff --git a/scripts/ipdiff.sh b/scripts/ipdiff.sh new file mode 100755 index 0000000..1aeef2a --- /dev/null +++ b/scripts/ipdiff.sh @@ -0,0 +1,31 @@ +# ipdiff.sh +# For non-shared BMC LAN channels, take the OS IP and add an increment, +# then run pefconfig -I to set the new BMC LAN IP. +# +# eth: Get the OS IP from eth0 by default +# incr: Increment is 128. by default +# Customers may wish to customize the $eth and $incr parameters below to +# vary these for their network environments. +# +# This produces a series of systems with IP addresses allocated like this: +# OS IP BMC LAN IP +# system1 192.168.0.1 192.168.0.129 +# system2 192.168.0.2 192.168.0.130 +# system3 192.168.0.3 192.168.0.131 +# ... +eth=eth0 +incr=128 +ip=`ifconfig $eth |grep "inet addr:" |cut -f2 -d':' |awk '{print $1}'` +last=`echo $ip |cut -f4 -d'.'` +first=`echo $ip |cut -f1-3 -d'.'` +sysname=`uname -n` + +newlast=`expr $last + $incr` +if [ $newlast -ge 255 ] +then + # overflow, so wrap IP (could return error instead) + newlast=`expr $newlast - 255` +fi +newip=${first}.${newlast} +echo "$sysname: $eth IP = $ip, BMC IP = $newip" +ipmiutil lan -e -I $newip diff --git a/scripts/ipicmg b/scripts/ipicmg new file mode 100755 index 0000000..d66588e --- /dev/null +++ b/scripts/ipicmg @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil picmg $* diff --git a/scripts/ipmi.init.basic b/scripts/ipmi.init.basic new file mode 100755 index 0000000..f12c743 --- /dev/null +++ b/scripts/ipmi.init.basic @@ -0,0 +1,80 @@ +#!/bin/sh +# +# ipmi: OpenIPMI Driver init script (basic only) +# Author: Andy Cress +# +# chkconfig: - 13 87 +# description: OpenIPMI Driver init script +# +# Use this if the Linux distro does not provide one. +#Sample script to install it without chkconfig: +#===== +#ipmisvc=/etc/init.d/ipmi +#cp -f ipmi.init.basic $ipmisvc +#ln -s $ipmisvc /etc/rc0.d/K87ipmi +#ln -s $ipmisvc /etc/rc1.d/K87ipmi +#ln -s $ipmisvc /etc/rc6.d/K87ipmi +#ln -s $ipmisvc /etc/rc2.d/S13ipmi +#ln -s $ipmisvc /etc/rc3.d/S13ipmi +#ln -s $ipmisvc /etc/rc4.d/S13ipmi +#ln -s $ipmisvc /etc/rc5.d/S13ipmi +#===== +# +rv=0 + +start() { + lsmod |grep ipmi_dev >/dev/null + if [ $? -ne 0 ]; then + echo "Starting OpenIPMI driver ..." + # load the ipmi modules, if not already loaded or builtin + cat /proc/kallsyms |grep ipmi_init_msghandler >/dev/null 2>&1 + if [ $? -ne 0 ]; then + modprobe ipmi_msghandler + fi + cat /proc/kallsyms |grep init_ipmi_si >/dev/null 2>&1 + if [ $? -ne 0 ]; then + modprobe ipmi_si + rv=$? + if [ $rv -ne 0 ]; then + modprobe ipmi_si_drv # try old module name + fi + fi + modprobe ipmi_devintf + modprobe ipmi_watchdog 2>/dev/null + fi + + maj=$(cat /proc/devices | awk '/ipmidev/{print $1}') + if [ "x$maj" != "x" ]; then + test -e /dev/ipmi0 && rm -f /dev/ipmi0 + /bin/mknod /dev/ipmi0 c $maj 0 + fi +} + +stop() { + lsmod |grep ipmi_msghandler >/dev/null + if [ $? -eq 0 ]; then + echo "Stopping OpenIPMI driver ..." + rmmod ipmi_poweroff 2>/dev/null + rmmod ipmi_watchdog 2>/dev/null + rmmod ipmi_devintf 2>/dev/null + rmmod ipmi_si + rv=$? + rmmod ipmi_msghandler + else + rv=2 + fi +} + +status() { + lsmod |grep ipmi + rv=$? +} + +case "$1" in + start) start ;; + stop) stop ;; + status) status ;; + *) start ;; +esac + +exit $rv diff --git a/scripts/ipmi_if.sh b/scripts/ipmi_if.sh new file mode 100755 index 0000000..4068717 --- /dev/null +++ b/scripts/ipmi_if.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# ipmi_if.sh +# detect IPMI Interface type, usually KCS or SSIF +# +# Future: also include preferred Driver type on another line +# +# ifdir=/usr/share/ipmiutil +ifdir=/var/lib/ipmiutil +ifout=$ifdir/ipmi_if.txt +dmiout=/tmp/dmi.out.$$ + +mkdir -p $ifdir +which dmidecode >/dev/null 2>&1 +if [ $? -ne 0 ] +then + # if no dmidecode, old, so assume KCS + echo "Interface type: KCS" >$ifout + exit 0 +fi +dmidecode >$dmiout +# dmidecode |grep IPMI >/dev/null 2>&1 +grep IPMI $dmiout >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "Interface type: None" >$ifout + exit 0 +fi +iftype=`grep "Interface Type:" $dmiout |cut -f2 -d':'` +echo $iftype |grep KCS >/dev/null 2>&1 +if [ $? -eq 0 ] +then + echo "Interface type: KCS" >$ifout +else + echo $iftype |grep "OUT OF SPEC" >/dev/null 2>&1 + if [ $? -eq 0 ] + then + echo "Interface type: SSIF" >$ifout + else + echo "Interface type: $iftype" >$ifout + fi +fi +# echo "IPMI `cat $ifout` interface found" + +sa=`grep "I2C Slave Address:" $dmiout |cut -f2 -d':'` +echo "I2C Slave Address: $sa" >>$ifout +base=`grep "Base Address:" $dmiout |tail -n1 |cut -f2 -d':'` +echo "Base Address: $base" >>$ifout + +spacing=1 +spac_str=`grep "Register Spacing:" $dmiout |cut -f2 -d':'` +echo $spac_str | grep "Successive Byte" >/dev/null 2>&1 +if [ $? -eq 0 ]; then + spacing=1 +else + echo $spac_str | grep "32-bit" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + spacing=4 + else + spacing=2 + fi +fi +echo "Register Spacing: $spacing" >>$ifout + +biosver=`grep "Version: " $dmiout |head -n1 |cut -f2 -d':'` +echo "BIOS Version: $biosver" >>$ifout +exit 0 diff --git a/scripts/ipmi_info b/scripts/ipmi_info new file mode 100755 index 0000000..b3b3f9a --- /dev/null +++ b/scripts/ipmi_info @@ -0,0 +1,124 @@ +#! /bin/sh +# +# ipmi_info +# +# chkconfig: 345 91 07 +# description: ipmi_info saves the OS info (hostname, OS release) into +# the IPMI System Info variables, if supported. +# It does nothing if IPMI System Info is not supported. +# +### BEGIN INIT INFO +# Provides: ipmi_info +# Required-Start: $local_fs $network $remote_fs +# Required-Stop: $local_fs $network $remote_fs +# Default-Start: +# Default-Stop: +# Short-Description: ipmi_info saves OS info to the IPMI system info +# Description: ipmi_info saves OS info to the IPMI system info +### END INIT INFO + +name=ipmi_info +iuprog=/usr/bin/ipmiutil +tmp=/tmp/ipmi_info.tmp + +getosver() { + if [ -f /etc/os-release ]; then + . /etc/os-release + echo "${NAME} ${VERSION} kernel ${KERNEL_VERSION}" + elif [ -f /etc/redhat-release ]; then + cat /etc/redhat-release |head -n1 + elif [ -f /etc/SuSE-release ]; then + cat /etc/SuSE-release |head -n1 + elif [ -f /etc/mvl-release ]; then + sver=`grep Monta /etc/mvl-release |awk '{ print $4 }' |cut -f1 -d'.'` + echo "Monta Vista Linux version $sver" + elif [ -f /etc/debian_version ]; then + sver=`grep Debian /etc/issue |awk '{ print $3 }'` + echo "Debian Linux version $sver" + else + sver=`uname -r` + styp=`uname -s` + echo "$styp $sver" + fi +} + +start() +{ + echo -n $"Starting $name: " + echo + retval=0 + PID=0 + + ${iuprog} health -i >$tmp 2>&1 + if [ $? -eq 0 ]; then + name=`hostname` + os=`getosver` + echo "setting name=$name, os=$os ..." >>$tmp + ${iuprog} health -n "$name" >>$tmp 2>&1 + ${iuprog} health -o "$os" >>$tmp 2>&1 + else + # IPMI System Info is not supported. + retval=0 + fi + echo + return $retval +} + +stop() +{ + echo -n $"Stopping $name: " + echo + retval=0 + echo + return $retval +} + +restart() +{ + stop + start +} + +rh_status() { + echo "$name is stopped" + retval=3 + return $retval +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + status) + rh_status + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + restart + ;; + force_reload) + restart + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac + +exit $? + diff --git a/scripts/ipmi_port.service b/scripts/ipmi_port.service new file mode 100644 index 0000000..d09b37c --- /dev/null +++ b/scripts/ipmi_port.service @@ -0,0 +1,15 @@ +[Unit] +Description=ipmiutil ipmi_port service +After=network.target + +[Service] +Type=forking +PIDFile=/run/ipmi_port.pid +EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env +ExecStartPre=/usr/share/ipmiutil/ipmiutil.setup +ExecStart=/usr/sbin/ipmi_port -b + +[Install] +WantedBy=multi-user.target + + diff --git a/scripts/ipmi_port.sh b/scripts/ipmi_port.sh new file mode 100755 index 0000000..85539ea --- /dev/null +++ b/scripts/ipmi_port.sh @@ -0,0 +1,187 @@ +#! /bin/sh +# +# ipmi_port +# +# chkconfig: 345 91 07 +# description: ipmi_port reserves the IPMI RMCP port 623 from portmap +# which prevents portmap from trying to use port 623. +# This script also applies any saved IPMI thresholds, and +# copies the bmclanpet.mib to where SNMP can find it. +# It is recommended that this service be started for +# all systems with ipmiutil that also have portmap. +# +### BEGIN INIT INFO +# Provides: ipmi_port +# Required-Start: $local_fs $network $remote_fs +# Required-Stop: $local_fs $network $remote_fs +# Default-Start: 3 4 5 3 4 5 +# Default-Stop: 0 1 2 6 0 1 2 6 +# Short-Description: ipmi_port reserves the RMCP port from portmap +# Description: ipmi_port is used to reserve the RMCP port from portmap +### END INIT INFO +# +#if [ -f /etc/init.d/functions ]; then +# Source function library. +#. /etc/init.d/functions +#fi + +name=ipmi_port +progdir=/usr/sbin +prog="$progdir/$name" +lockfile=/var/lock/subsys/$name +portmap=/etc/init.d/portmap +shardir=/usr/share +mibdir=$shardir/snmp/mibs +datadir=$shardir/ipmiutil +vardir=/var/lib/ipmiutil +ifout=${vardir}/ipmi_if.txt +sensorout=${vardir}/sensor_out.txt +threshout=${vardir}/thresh_out.txt +# This threshold script could be created by ipmiutil sensor -p ... +thresh="${vardir}/thresholds.sh" + +getpid () { + # This is messy if the parent script is same name as $1 + p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` + echo $p +} + +start() +{ + echo -n $"Starting $name: " + echo + retval=1 + PID=0 + + mkdir -p $vardir + # if [ ! -f $ifout ]; then + # ${datadir}/ipmi_if.sh + # fi + if [ ! -f $sensorout ]; then + # Capture a snapshot of IPMI sensor data for later reuse. + ipmiutil sensor -q >$sensorout + fi + if [ -f $thresh ] + then + # apply saved IPMI sensor thresholds, if any + sh $thresh >$threshout 2>&1 + fi + if [ -d ${mibdir} ] + then + # put bmclanpet MIB where SNMP can find it + cp -f $datadir/bmclanpet.mib ${mibdir}/BMCLAN-PET-MIB.txt + fi + + dpc=`getpid dpcproxy` + if [ "x${dpc}" != "x" ] + then + echo "$name: dpcproxy is already running on port 623," + echo "so $name is not needed." + retval=6 + else + [ -x $portmap ] || exit 6 + [ -x $prog ] || exit 5 + $prog -b + retval=$? + if [ $retval -eq 0 ]; then + PID=`getpid "$prog -b"` + echo $PID >$lockfile + fi + fi + echo + return $retval +} + +stop() +{ + echo -n $"Stopping $name: " + echo + retval=1 + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" = "x" ]; then + p=`getpid "$prog -b"` + fi + if [ "x$p" != "x" ]; then + kill $p + retval=$? + fi + fi + echo + if [ -d ${mibdir} ]; then + rm -f ${mibdir}/BMCLAN-PET-MIB.txt + fi + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() +{ + stop + start +} + +rh_status() { + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" != "x" ]; then + pid=`getpid $p` + if [ "x$pid" != "x" ]; then + echo "$name (pid $pid) is running..." + retval=0 + else + echo "$name is dead but $lockfile exists" + retval=1 + fi + else + echo "$name $lockfile exists but is empty" + retval=2 + fi + else + echo "$name is stopped" + retval=3 + fi + return $retval +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +if [ ! -d /var/lock/subsys ]; then + lockfile=/var/run/$name.pid +fi + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + status) + rh_status + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + restart + ;; + force_reload) + restart + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac + +exit $? + diff --git a/scripts/ipmiutil.env b/scripts/ipmiutil.env new file mode 100644 index 0000000..e06bdda --- /dev/null +++ b/scripts/ipmiutil.env @@ -0,0 +1,22 @@ +#!/bin/sh +# These environment variables go with ipmiutil systemd services. +# +IDATADIR=/usr/share/ipmiutil + +# For ipmiutil_evt +# Its log is /var/log/ipmiutil_evt.log +IPMIUTILEVTARGS="-s -b -t 0" +# to run a script for each IPMI event, use this instead: +# IPMIUTILEVTARGS="-s -b -t 0 -r /usr/share/ipmiutil/evt.sh" + +# For ipmiutil_asy: +# Its log is /var/log/ipmiutil_asy.log + +# For ipmi_port: +IPORTMAP=/etc/init.d/portmap +IMIBDIR=/usr/share/snmp/mibs +IVARDIR=/var/lib/ipmiutil +ISENSOROUT=${IVARDIR}/sensor_out.txt +# This threshold script could be created by ipmiutil sensor -p ... +ITHRESH="${IVARDIR}/thresholds.sh" +IINITDIR=/etc/init.d diff --git a/scripts/ipmiutil.pre b/scripts/ipmiutil.pre new file mode 100755 index 0000000..a059dcc --- /dev/null +++ b/scripts/ipmiutil.pre @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Before starting an ipmiutil service, make sure we have a driver loaded, +# since running driverless for multi-user is not supported. +/usr/bin/ipmiutil cmd -k 2>/dev/null |grep "driverless" >/dev/null 2>&1 +if [ $? -eq 0 ]; then + rv=1 + echo "No Linux IPMI driver loaded, aborting." +else + rv=0 +fi +exit $rv diff --git a/scripts/ipmiutil.setup b/scripts/ipmiutil.setup new file mode 100755 index 0000000..9087021 --- /dev/null +++ b/scripts/ipmiutil.setup @@ -0,0 +1,47 @@ +#! /bin/sh +# ipmiutil ipmi_port setup script for systemd +# + +. /usr/share/ipmiutil/ipmiutil.env + +getpid () { + # This is messy if the parent script is same name as $1 + p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` + echo $p +} + +isetup() { + retval=1 + PID=0 + + mkdir -p $IVARDIR + if [ ! -f $ISENSOROUT ]; then + # Capture a snapshot of IPMI sensor data for later reuse. + ipmiutil sensor -q >$ISENSOROUT + fi + if [ -f $ITHRESH ] + then + # apply saved IPMI sensor thresholds, if any + sh $ITHRESH + fi + if [ -d ${IMIBDIR} ] + then + # put bmclanpet MIB where SNMP can find it + cp -f $IDATADIR/bmclanpet.mib ${IMIBDIR}/BMCLAN-PET-MIB.txt + fi + + dpc=`getpid dpcproxy` + if [ "x${dpc}" != "x" ] + then + echo "dpcproxy is already running on port 623, so not needed." + retval=6 + else + # portmap may have been replaced by portreserve + [ -x $IPORTMAP ] || exit 6 + retval=0 + fi + return $retval +} + +isetup + diff --git a/scripts/ipmiutil_asy b/scripts/ipmiutil_asy new file mode 100755 index 0000000..2899af4 --- /dev/null +++ b/scripts/ipmiutil_asy @@ -0,0 +1,155 @@ +#! /bin/sh +# +# ipmiutil_asy init script +# +# chkconfig: - 91 59 +# description: ipmiutil async bridge agent, listens for IPMI LAN client requests +# +# This starts a daemon that listens for asynchronous IPMI LAN soft-shutdown +# requests from a remote ipmiutil reset (-o/-D). It depends upon an imb or +# openipmi driver. +# +### BEGIN INIT INFO +# Provides: ipmiutil_asy +# Required-Start: $local_fs $remote_fs $syslog +# Required-Stop: $local_fs $remote_fs $syslog +# Default-Start: 3 4 5 3 4 5 +# Default-Stop: 0 1 2 6 0 1 2 6 +# Short-Description: ipmiutil async bridge agent init script +# Description: Init script starts ipmiutil async bridge agent for remote reset +### END INIT INFO +# + +#if [ -f /etc/init.d/functions ]; then +# Source function library. +#. /etc/init.d/functions +#fi + +name="ipmiutil_asy" +dname="ipmiutil_asy bridge agent" +getevtlog=/var/log/${name}.log +lockfile=/var/lock/subsys/${name} +prog=/usr/bin/ipmiutil + + +getpid () { + p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` + echo $p +} + +start() +{ + echo -n $"Starting $dname: " + driverok=0 + dtype=`ipmiutil cmd -k |grep "IPMI access" |cut -f2 -d'=' |awk '{ print $1 }'` + if [ "x$dtype" = "xopen" ]; then + driverok=1 + fi + if [ "x$dtype" = "ximb" ]; then + driverok=1 + fi + if [ $driverok -eq 1 ] + then + [ -x $prog ] || exit 5 + $prog getevt -a -b >$getevtlog & + retval=$? + PID=$! + if [ $retval -eq 0 ]; then + echo $PID >$lockfile + fi + else + echo "No imb or ipmi driver loaded, aborting." + retval=1 + fi + echo + return $retval +} + +stop() +{ + echo -n $"Stopping $dname: " + retval=1 + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" = "x" ]; then + p=`getpid "$prog getevt -a"` + fi + if [ "x$p" != "x" ]; then + kill $p + retval=$? + fi + fi + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + + +rh_status() { + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" != "x" ]; then + pid=`getpid $p` + if [ "x$pid" != "x" ]; then + echo "$dname (pid $pid) is running..." + retval=0 + else + echo "$dname is dead but $lockfile exists" + retval=1 + fi + else + echo "$dname $lockfile exists but is empty" + retval=1 + fi + else + echo "$dname is stopped" + retval=3 + fi + return $retval +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +if [ ! -d /var/lock/subsys ]; then + lockfile=/var/run/${name}.pid +fi + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + restart + ;; + force-reload) + restart + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac +exit $? + diff --git a/scripts/ipmiutil_asy.service b/scripts/ipmiutil_asy.service new file mode 100644 index 0000000..d9eabdc --- /dev/null +++ b/scripts/ipmiutil_asy.service @@ -0,0 +1,14 @@ +[Unit] +Description=ipmiutil Async Bridge Agent +After=network.target + +[Service] +Type=forking +PIDFile=/run/ipmiutil_asy.pid +EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env +ExecStartPre=/usr/share/ipmiutil/ipmiutil.pre +ExecStart=/usr/bin/ipmiutil getevt -a -b + +[Install] +WantedBy=multi-user.target + diff --git a/scripts/ipmiutil_evt b/scripts/ipmiutil_evt new file mode 100755 index 0000000..e8a9e20 --- /dev/null +++ b/scripts/ipmiutil_evt @@ -0,0 +1,158 @@ +#! /bin/sh +# +# ipmiutil_evt init script +# +# chkconfig: - 91 59 +# description: ipmiutil event monitoring service +# +# This starts a daemon that listens for IPMI events. Any events are logged +# in /var/log/ipmiutil_evt.log and also to syslog. +# By changing RUNSCRIPT below, the specified script could also be invoked +# whenever an event occurs. A sample event script is provided at +# /usr/share/ipmiutil/evt.sh +# +### BEGIN INIT INFO +# Provides: ipmiutil_evt +# Required-Start: $local_fs $remote_fs $syslog +# Required-Stop: $local_fs $remote_fs $syslog +# Default-Start: 3 4 5 3 4 5 +# Default-Stop: 0 1 2 6 0 1 2 6 +# Short-Description: ipmiutil event monitoring init script +# Description: Init script starts ipmiutil event monitoring service +### END INIT INFO +# + +#if [ -f /etc/init.d/functions ]; then +# Source function library. +#. /etc/init.d/functions +#fi + +name="ipmiutil_evt" +getevtlog=/var/log/$name.log +lockfile=/var/lock/subsys/$name +prog=/usr/bin/ipmiutil +RUNSCRIPT= +# RUNSCRIPT="-r /usr/share/ipmiutil/evt.sh" + + +getpid () { + p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` + echo $p +} + +start() +{ + echo -n $"Starting $name: " + # do not start if in driverless mode + ipmiutil cmd -k |grep "driverless" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + driverok=0 + else + driverok=1 + fi + if [ $driverok -eq 1 ] + then + [ -x $prog ] || exit 5 + $prog getevt -s -b -t 0 $RUNSCRIPT >$getevtlog + retval=$? + PID=$! + if [ $retval -eq 0 ]; then + PID=`getpid "$prog getevt -s"` + echo $PID >$lockfile + fi + else + echo "No imb or ipmi driver loaded, aborting." + retval=1 + fi + echo + return $retval +} + +stop() +{ + echo -n $"Stopping $name: " + retval=1 + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" = "x" ]; then + p=`getpid "$prog getevt -s"` + fi + if [ "x$p" != "x" ]; then + kill $p + retval=$? + fi + fi + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + + +rh_status() { + if [ -f $lockfile ]; then + p=`cat $lockfile` + if [ "x$p" != "x" ]; then + pid=`getpid $p` + if [ "x$pid" != "x" ]; then + echo "$name (pid $pid) is running..." + retval=0 + else + echo "$name is dead but $lockfile exists" + retval=1 + fi + else + echo "$name $lockfile exists but is empty" + retval=1 + fi + else + echo "$name is stopped" + retval=3 + fi + return $retval +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + +if [ ! -d /var/lock/subsys ]; then + lockfile=/var/run/$name.pid +fi + +case "$1" in + start) + rh_status_q && exit 0 + start + ;; + stop) + rh_status_q || exit 0 + stop + ;; + restart) + restart + ;; + reload) + rh_status_q || exit 7 + restart + ;; + force-reload) + restart + ;; + status) + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac +exit $? + diff --git a/scripts/ipmiutil_evt.service b/scripts/ipmiutil_evt.service new file mode 100644 index 0000000..3cd5b6d --- /dev/null +++ b/scripts/ipmiutil_evt.service @@ -0,0 +1,15 @@ +[Unit] +Description=ipmiutil Event Daemon +After=network.target + +[Service] +Type=forking +PIDFile=/run/ipmiutil_evt.pid +EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env +ExecStartPre=/usr/share/ipmiutil/ipmiutil.pre +ExecStart=/usr/bin/ipmiutil getevt $IPMIUTILEVTARGS + +[Install] +WantedBy=multi-user.target + + diff --git a/scripts/ipmiutil_wdt b/scripts/ipmiutil_wdt new file mode 100755 index 0000000..6c2bd73 --- /dev/null +++ b/scripts/ipmiutil_wdt @@ -0,0 +1,146 @@ +#! /bin/sh +# +# wdt Enable & reset the IPMI watchdog timer via cron +# +# chkconfig: - 91 59 +# description: wdt is a utility from ipmiutil.sf.net to configure the \ +# IPMI watchdog timer. +# +# It enables watchdog for 90 second timeout, reset every 1 min (60 sec). +# It uses the cron daemon which reads files from /etc/cron.d +# Note that the $crond_sh variable is different for RedHat & SuSE. +# +### BEGIN INIT INFO +# Provides: ipmiutil_wdt +# Required-Start: $local_fs $remote_fs $syslog +# Required-Stop: $local_fs $remote_fs $syslog +# Default-Start: 3 4 5 3 4 5 +# Default-Stop: 0 1 2 6 0 1 2 6 +# Short-Description: ipmiutil watchdog timer init script +# Description: Init script to enable and reset ipmiutil watchdog timer via cron +### END INIT INFO +# +#if [ -f /etc/init.d/functions ]; then +# Source function library. +#. /etc/init.d/functions +#fi + +name=ipmiutil_wdt +prog="/usr/bin/ipmiutil wdt" +wdtcron=/etc/cron.d/wdt +LOCKFILE=/var/lock/subsys/$name +wdtlog=/var/log/$name +#tmpcron=/tmp/wdtcron.$$ +# tmpcron2=/tmp/wdtcron2.$$ + +start() { + echo -n $"Starting $prog: " + echo + # do not start if in driverless mode + ipmiutil cmd -k |grep "driverless" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + driverok=0 + else + driverok=1 + fi + if [ $driverok -eq 0 ] + then + echo "No ipmi driver loaded, aborting." + RETVAL=1 + else + # configure the watchdog for a 90 second timeout + $prog -e -t 90 >$wdtlog + RETVAL=$? + if [ $RETVAL -eq 0 ] + then + # restart the watchdog every 60 seconds via crontab (skip) + # cat - <<%%% >$tmpcron +#* * * * * $prog -r +#%%% + # crontab $tmpcron + # RETVAL=$? + # restart the watchdog every 60 seconds via /etc/cron.d + cat - <<%%% >$wdtcron +* * * * * root $prog -r +%%% + # make crond re-read the /etc/cron.d + $crond_sh restart >>$wdtlog + touch $LOCKFILE + fi + fi + echo + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + echo + # first disable the watchdog + $prog -d >>$wdtlog + RETVAL=$? + # now remove the wdt cron job + # crontab -l >$tmpcron + # grep -v $prog $tmpcron |grep -v "^#" >$tmpcron2 + # crontab $tmpcron2 + rm -f $wdtcron + # make crond re-read the /etc/cron.d + $crond_sh restart >>$wdtlog + rm -f ${LOCKFILE} + echo + return $RETVAL +} + +restart() { + stop + start +} + +get_status() { + $prog + if [ -f ${LOCKFILE} ]; then + if [ -f $wdtcron ]; then + echo "$name is running..." + retval=0 + else + echo "$name is not running but ${LOCKFILE} exists" + retval=1 + fi + else + echo "$name is stopped" + retval=3 + fi + return $retval +} + +# Begin mainline script here +if [ -f /etc/redhat-release ] +then + crond_sh=/etc/init.d/crond +else + # SuSE, MontaVista, etc. + crond_sh=/etc/init.d/cron +fi +if [ ! -d /var/lock/subsys ]; then + LOCKFILE=/var/run/$name.pid +fi + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + get_status + ;; + restart) + restart + ;; + reload) + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|reload}" + exit 1 +esac diff --git a/scripts/ipmiutil_wdt.cmd b/scripts/ipmiutil_wdt.cmd new file mode 100755 index 0000000..6c74c20 --- /dev/null +++ b/scripts/ipmiutil_wdt.cmd @@ -0,0 +1,10 @@ +REM ipmiutil_wdt.cmd +REM wdt Reset the IPMI watchdog timer every NSEC seconds + +set NSEC 60 + +:WDTLOOP +ipmiutil wdt -r +sleep %NSEC% +goto WDTLOOP + diff --git a/scripts/ipmiutil_wdt.service b/scripts/ipmiutil_wdt.service new file mode 100644 index 0000000..6f67fad --- /dev/null +++ b/scripts/ipmiutil_wdt.service @@ -0,0 +1,14 @@ +[Unit] +Description=ipmiutil Watchdog Timer Service using cron +After=network.target + +[Service] +ExecStart=/usr/share/ipmiutil/ipmiutil_wdt start +ExecStop=/usr/share/ipmiutil/ipmiutil_wdt stop +ExecReload=/usr/share/ipmiutil/ipmiutil_wdt restart +RemainAfterExit=1 + +[Install] +WantedBy=multi-user.target + + diff --git a/scripts/ireset b/scripts/ireset new file mode 100755 index 0000000..86926a3 --- /dev/null +++ b/scripts/ireset @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil reset $* diff --git a/scripts/ireset.cmd b/scripts/ireset.cmd new file mode 100644 index 0000000..a0d07af --- /dev/null +++ b/scripts/ireset.cmd @@ -0,0 +1 @@ +ipmiutil reset %*
diff --git a/scripts/isel b/scripts/isel new file mode 100755 index 0000000..ef7f958 --- /dev/null +++ b/scripts/isel @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil sel $* diff --git a/scripts/isel.cmd b/scripts/isel.cmd new file mode 100644 index 0000000..9aba3b9 --- /dev/null +++ b/scripts/isel.cmd @@ -0,0 +1 @@ +ipmiutil sel %*
diff --git a/scripts/isensor b/scripts/isensor new file mode 100755 index 0000000..781f1dc --- /dev/null +++ b/scripts/isensor @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil sensor $* diff --git a/scripts/isensor.cmd b/scripts/isensor.cmd new file mode 100644 index 0000000..9441517 --- /dev/null +++ b/scripts/isensor.cmd @@ -0,0 +1 @@ +ipmiutil sensor %*
diff --git a/scripts/iserial b/scripts/iserial new file mode 100755 index 0000000..ca18c35 --- /dev/null +++ b/scripts/iserial @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil serial $* diff --git a/scripts/iserial.cmd b/scripts/iserial.cmd new file mode 100644 index 0000000..4af066f --- /dev/null +++ b/scripts/iserial.cmd @@ -0,0 +1 @@ +ipmiutil serial %*
diff --git a/scripts/isol b/scripts/isol new file mode 100755 index 0000000..5cba66d --- /dev/null +++ b/scripts/isol @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil sol $* diff --git a/scripts/isol.cmd b/scripts/isol.cmd new file mode 100644 index 0000000..73222bd --- /dev/null +++ b/scripts/isol.cmd @@ -0,0 +1 @@ +ipmiutil sol %*
diff --git a/scripts/iwdt b/scripts/iwdt new file mode 100755 index 0000000..129c265 --- /dev/null +++ b/scripts/iwdt @@ -0,0 +1,2 @@ +#!/bin/sh +ipmiutil wdt $* diff --git a/scripts/iwdt.cmd b/scripts/iwdt.cmd new file mode 100644 index 0000000..fe5d4e0 --- /dev/null +++ b/scripts/iwdt.cmd @@ -0,0 +1 @@ +ipmiutil wdt %*
diff --git a/scripts/setlib.sh b/scripts/setlib.sh new file mode 100755 index 0000000..eca184e --- /dev/null +++ b/scripts/setlib.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# setup sequence for ipmiutil +# +# Resolve whatever libcrypto.so is present to the one that ipmiutil +# was built to reference. +# The default build on RHEL4.4 references libcrypto.so.4 +libver=4 +found=0 + +# check where the libcrypto.so is located +dirs="/usr/lib64 /lib64 /usr/lib /lib" +for d in $dirs +do + libt=`ls $d/libcrypto.so.0.* 2>/dev/null |tail -n1` + if [ "x$libt" != "x" ]; then + # Found a libcrypto.so + libcry=$libt + libdir=$d + found=1 + libnew=$libdir/libcrypto.so.$libver + echo "libcry=$libcry libdir=$libdir libnew=$libnew" + if [ ! -f $libnew ]; then + # Need a sym-link to resolve it + echo "ln -s $libcry $libnew" + ln -s $libcry $libnew + ldconfig + fi + fi +done + +if [ $found -eq 0 ]; then + echo "libcrypto.so not found, install openssl rpm" + rv=1 +else + rv=0 +fi +exit $rv + diff --git a/scripts/showsel.mc b/scripts/showsel.mc new file mode 100644 index 0000000..6efd47c --- /dev/null +++ b/scripts/showsel.mc @@ -0,0 +1,29 @@ +; // This is the header section.
+
+MessageIdTypedef=DWORD
+
+SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
+ Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
+ Warning=0x2:STATUS_SEVERITY_WARNING
+ Error=0x3:STATUS_SEVERITY_ERROR
+ )
+
+FacilityNames=(System=0x0:FACILITY_SYSTEM
+ Runtime=0x2:FACILITY_RUNTIME
+ Stubs=0x3:FACILITY_STUBS
+ Io=0x4:FACILITY_IO_ERROR_CODE
+ )
+
+LanguageNames=(English=0x409:MSG00409)
+
+; // The following are message definitions.
+
+MessageId=0x101
+Severity=Informational
+Facility=System
+SymbolicName=MSG_SEL_RECORD
+Language=English
+SEL: %1
+.
+
+
diff --git a/scripts/showsel.reg b/scripts/showsel.reg new file mode 100644 index 0000000..036876f --- /dev/null +++ b/scripts/showsel.reg @@ -0,0 +1,10 @@ +REGEDIT4
+
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel]
+"EventMessageFile"="%SystemRoot%\\system32\\showselmsg.dll"
+"TypesSupported"=dword:00000007
+"IndexFile"="%ipmiutildir%\\sel.idx"
+
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule]
+"AtTaskMaxHours"=dword:00000000
+
diff --git a/scripts/showselun.reg b/scripts/showselun.reg new file mode 100644 index 0000000..8b4622c --- /dev/null +++ b/scripts/showselun.reg @@ -0,0 +1,4 @@ +REGEDIT4
+
+[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel]
+
diff --git a/scripts/startsol b/scripts/startsol new file mode 100755 index 0000000..8884e4d --- /dev/null +++ b/scripts/startsol @@ -0,0 +1,16 @@ +# start a serial-over-lan session +# BMC port 0x26f (=623). +# +if [ $# -gt 0 ] +then + host=$1 +else + host=telco64 +fi +echo "Starting Serial-Over-LAN session to $host ..." + +# Use isolconsole application for IPMI LAN 2.0 SOL +# If IPMI 1.5, use dpccli. + +ipmiutil sol -a -N $host + diff --git a/scripts/uninstall.cmd b/scripts/uninstall.cmd new file mode 100644 index 0000000..33ebaed --- /dev/null +++ b/scripts/uninstall.cmd @@ -0,0 +1,31 @@ +@echo off
+REM uninstall Windows ipmiutil on this system
+REM uninstall the DLLs, registry entries, and stop the checksel task
+set installdir=%SystemDrive%\Program Files\sourceforge\ipmiutil
+
+"%installdir%\showselun.reg"
+del /Q %SystemRoot%\system32\showsel.dll
+
+REM remove %installdir% from the PATH
+set pathkey="HKLM\System\CurrentControlSet\Control\Session Manager\Environment"
+REM reg query %pathkey% /v Path |findstr Path
+set NEWPATH=%PATH:;%installdir%=%
+reg add %pathkey% /v Path /t REG_EXPAND_SZ /d "%NEWPATH%"
+set PATH=%NEWPATH%
+
+REM type "%installdir%\checksel.id"
+FOR /F "usebackq tokens=1*" %%i IN (`type "%installdir%\checksel.id"`) DO call :SETAT %%i %%j
+goto :NEXTJ
+
+:SETAT
+REM %1 %2 %3 %4 %5 %6 %7 %8
+REM Added a new job with job ID = 2
+echo %1 %2 %3 %4 %5 %6 %7 %8 %9
+set ATJOB=%8
+echo at %ATJOB% /DELETE
+at %ATJOB% /DELETE
+goto :EOF
+
+:NEXTJ
+
+del /Q "%installdir%\*.*"
diff --git a/scripts/uninstall.vbs b/scripts/uninstall.vbs new file mode 100644 index 0000000..b392a46 --- /dev/null +++ b/scripts/uninstall.vbs @@ -0,0 +1,63 @@ +' This VBScript should run before any files are actually removed
+
+On Error Resume Next
+
+Set sh = CreateObject("WScript.Shell")
+' Set fso = CreateObject("Scripting.FileSystemObject")
+
+Dim installer : Set installer = Nothing
+Set installer = CreateObject("WindowsInstaller.Installer")
+
+'key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot"
+'SysLoc = sh.RegRead(key) & "\system32"
+
+' remove the showsel EventLog source entries
+keybase = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel"
+key1 = keybase & "\EventMessageFile"
+key2 = keybase & "\TypesSupported"
+sh.RegDelete key1
+sh.RegDelete key2
+sh.RegDelete keybase
+
+' Find out where our files were installed
+If(IsEmpty(Session)) Then
+ 'Not running from within installer. Source path is current directory.
+ InstallLoc = sh.CurrentDirectory
+Else
+ 'Running inside the installer, use CustomActionData "[TARGETDIR]".
+ ' InstallLoc = installer.ProductInfo(productCode, "InstallLocation")
+ InstallLoc = Session.Property("CustomActionData")
+ If(IsEmpty(InstallLoc)) Then
+ InstallLoc = "C:\Program Files\sourceforge\ipmiutil"
+ End If
+End If
+' wscript.echo "InstallLoc=" & InstallLoc
+
+' Remove the InstallLoc from the Environment Path
+key3 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path"
+EnvPath = sh.RegRead(key3)
+' wscript.echo "EnvPath= " & EnvPath
+
+' Calculates strStartAt which cuts the strSearchFor value from the path
+' strSearchFor = ";C:\program files\intel\ipmirastools"
+strSearchFor = ";" & InstallLoc
+newPath = EnvPath
+iStartAt = "0"
+strSearchForLen=len(strSearchFor)
+strStartAt = inStr(lCase(newPath), lCase(strSearchFor))
+If (strStartAt > "0") then
+ iStartAt = (strStartAt-1)
+' wscript.echo "strStartAt= " & strStartAt & " iStartAt= " & iStartAt
+
+' Builds the new Path
+' Joins the Values to the left and right of strSearchFor
+ strTotalLen=len(newPath)
+ newPathLeft=left(newPath,iStartAt)
+ newPathRight=right(newPath, (strTotalLen-strSearchForLen-iStartAt))
+ newPath=newPathLeft + newPathRight
+end if
+
+' wscript.echo "newPath= " & newPath
+sh.RegWrite key3, newPath, "REG_EXPAND_SZ"
+
+
|