Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
git-svn-id: https://nodediag.googlecode.com/svn/trunk@2 86045c6f-52ac-7900-fa0b-1f115c156771
  • Loading branch information
garlick.jim committed Nov 10, 2010
1 parent 4694cd1 commit 2d321e3
Show file tree
Hide file tree
Showing 29 changed files with 2,338 additions and 0 deletions.
340 changes: 340 additions & 0 deletions COPYING

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions DISCLAIMER
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
NOTICE

A. This notice is required to be provided under our contract with the U.S.
Department of Energy (DOE). This work was produced at the Lawrence
Livermore National Laboratory under Contract No. DE-AC52-07NA27344
with the DOE.

B. Neither the United States Government nor Lawrence Livermore National
Security, LLC nor any of their employees, makes any warranty, express or
implied, or assumes any liability or responsibility for the accuracy,
completeness, or usefulness of any information, apparatus, product, or
process disclosed, or represents that its use would not infringe
privately-owned rights.

C. Also, reference herein to any specific commercial products, process,
or services by trade name, trademark, manufacturer or otherwise does not
necessarily constitute or imply its endorsement, recommendation, or favoring
by the United States Government or Lawrence Livermore National Security, LLC.
The views and opinions of authors expressed herein do not necessarily
state or reflect those of the United States Government or Lawrence Livermore
National Security, LLC, and shall not be used for advertising or product
endorsement purposes.

The precise terms and conditions for copying, distribution and modification
are set forth in the file COPYING.
7 changes: 7 additions & 0 deletions META
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
##
# Metadata for RPM/TAR makefile targets
##
Meta: 1
Name: nodediag
Version: 1.0
Release: 1
39 changes: 39 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Other packages that want to make use of nodediag should add test to directory:
%{_sysconfdir}/nodediag.d/
configs should go into:
%{_sysconfdir}/sysconfig/nodediag.d/

Use one of the tests in /etc/nodediags.d as a template.

The test should define the following shell variables:
$prog name of the test
$description one-line description of the test
$sanity (optional) define only if test is quick

Tests normally include the following preamble:
# Source nodediag config and function library
. /etc/nodediag.d/functions || exit 2
. /etc/sysconfig/nodediag
diag_init
diag_handle_args "$@"

Utility functions:
diag_init
Ensures that prog and description are set. Exits on error.

diag_handle_args
Process arguments common to all tests. Exits on error or if
an option is provided that is handled immediately.

diag_check_defined "VARIABLE"
Tests if $VARIABLE is defined. By convention, variables defined in
/etc/sysconfig/nodediag.d/test or /etc/sysconfig/nodediag should be
named DIAG_TESTNAME_whatever. Exits if variable is not defined.

diag_check_root
Call this if the test requires root privileges. Exits if not root.

The test script should exit one of these ways:
exit $EXIT_OK # test succeeded
exit $EXIT_FAIL # test failed
exit $EXIT_NOTRUN # test could not be run
50 changes: 50 additions & 0 deletions diags/bios
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
##############################################################################
# Copyright (c) 2010, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# Written by Jim Garlick <[email protected]>.
# LLNL-CODE-461827
# All rights reserved.
#
# This file is part of nodediag.
# For details, see http://code.google.com/p/nodediag.
# Please also read the files DISCLAIMER and COPYING supplied with nodediag.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (as published by the
# Free Software Foundation) version 2, dated June 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# terms and conditions of the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
#
# description: Check the bios release date
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin

declare -r prog=${0##*/}
declare -r description="Check bios release date"
declare -r sanity=1

# Source nodediag config and function library
. /etc/nodediag.d/functions || exit 2
. /etc/sysconfig/nodediag

diagconfig ()
{
diag_config_dmi bios-release-date "DIAG_BIOS_DATE"
}

diag_init
diag_handle_args "$@"
diag_check_root
diag_check_defined "DIAG_BIOS_DATE"

diag_test_dmi bios-release-date "${DIAG_BIOS_DATE}"
50 changes: 50 additions & 0 deletions diags/cpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
##############################################################################
# Copyright (c) 2010, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# Written by Jim Garlick <[email protected]>.
# LLNL-CODE-461827
# All rights reserved.
#
# This file is part of nodediag.
# For details, see http://code.google.com/p/nodediag.
# Please also read the files DISCLAIMER and COPYING supplied with nodediag.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (as published by the
# Free Software Foundation) version 2, dated June 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# terms and conditions of the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
#
# description: Check that all cpus are correct version
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin

declare -r prog=${0##*/}
declare -r description="Check that all cpus are correct version"
declare -r sanity=1

# Source nodediag config and function library
. /etc/nodediag.d/functions || exit 2
. /etc/sysconfig/nodediag

diagconfig ()
{
diag_config_dmi processor-version "DIAG_CPU_VERSION"
}

diag_init
diag_handle_args "$@"
diag_check_root
diag_check_defined "DIAG_CPU_VERSION"

diag_test_dmi processor-version "${DIAG_CPU_VERSION}"
50 changes: 50 additions & 0 deletions diags/cpufreq
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
##############################################################################
# Copyright (c) 2010, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# Written by Jim Garlick <[email protected]>.
# LLNL-CODE-461827
# All rights reserved.
#
# This file is part of nodediag.
# For details, see http://code.google.com/p/nodediag.
# Please also read the files DISCLAIMER and COPYING supplied with nodediag.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (as published by the
# Free Software Foundation) version 2, dated June 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# terms and conditions of the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
#
# description: Check that all cpus are at the expected MHz
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin

declare -r prog=${0##*/}
declare -r description="Check that all cpus are correct speed"
declare -r sanity=1

# Source nodediag config and function library
. /etc/nodediag.d/functions || exit 2
. /etc/sysconfig/nodediag

diagconfig ()
{
diag_config_dmi processor-frequency "DIAG_CPUFREQ_MHZ"
}

diag_init
diag_handle_args "$@"
diag_check_root
diag_check_defined "DIAG_CPUFREQ_MHZ"

diag_test_dmi processor-frequency "${DIAG_CPUFREQ_MHZ}"
79 changes: 79 additions & 0 deletions diags/ecc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash
##############################################################################
# Copyright (c) 2010, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
# Written by Jim Garlick <[email protected]>.
# LLNL-CODE-461827
# All rights reserved.
#
# This file is part of nodediag.
# For details, see http://code.google.com/p/nodediag.
# Please also read the files DISCLAIMER and COPYING supplied with nodediag.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (as published by the
# Free Software Foundation) version 2, dated June 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# terms and conditions of the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
#
# description: Check that edac ecc of the proper type is enabled.
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin

declare -r prog=${0##*/}
declare -r description="Check EDAC ECC type"
declare -r sanity=1

# Source nodediag config and function library
. /etc/nodediag.d/functions || exit 2
. /etc/sysconfig/nodediag

getecctype()
{
local file

shopt -s nullglob
for file in /sys/devices/system/edac/mc/mc*/csrow*/edac_mode; do
cat $file
done
shopt -u nullglob
}

diagconfig ()
{
local ecctype=`getecctype | tail -1`

[ -z "$ecctype" ] && return 1
echo "DIAG_ECC_TYPE=\"$ecctype\""
}

diag_init
diag_handle_args "$@"
diag_check_defined "DIAG_ECC_TYPE"

eccenabled=0
EXITVAL=0

for ecctype in `getecctype`; do
eccenabled=1
if [ "$ecctype" != $DIAG_ECC_TYPE ]; then
echo "$prog: $file: $ecctype, expected $DIAG_ECC_TYPE" >&2
EXITVAL=$EXIT_FAIL
else
echo "$prog: $file: $ecctype" >&2
fi
done
if [ $eccenabled -eq 0 ]; then
echo "$prog: ECC is not enabled" >&2
EXITVAL=$EXIT_FAIL
fi
exit $EXITVAL
Loading

0 comments on commit 2d321e3

Please sign in to comment.