View Issue Details

IDProjectCategoryView StatusLast Update
0000054My infrastructure[All Projects] Generalpublic2019-03-01 13:58
Reporterdvl Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0000054: check_iocage_host_vs_jails.sh uses wrong path to iocage
Description[dan@x8dtu:/var/log] $ ': grep jail /usr/local/etc/nrpe.cfg
command[check_host_basejail]=/usr/local/libexec/nagios-custom/check_host_basejail
command[check_iocage_host_vs_jails]=/usr/local/bin/sudo /usr/local/libexec/nagios-custom/check_iocage_host_vs_jails.sh
command[check_pkg_audit_jail]=/usr/local/bin/sudo /usr/local/libexec/nagios-custom/pkg-audit.sh
command[check_py_iocage_host_vs_jails]=/usr/local/bin/sudo /usr/local/libexec/nagios-custom/check_py_iocage_host_vs_jails.sh
[dan@x8dtu:/var/log] $ cat /usr/local/libexec/nagios-custom/check_iocage_host_vs_jails.sh
#!/bin/sh

HOSTVERSION=`/usr/bin/file /bin/sh`

JAILS=`/usr/local/sbin/iocage list | /usr/bin/egrep -v '^JID' | /usr/bin/cut -f 2 -w`
ERRORS=''
for jail in ${JAILS}
do
  JAILVERSION=`/usr/local/sbin/iocage chroot ${jail} 'file /bin/sh'`
  if [ "${JAILVERSION}" != "${HOSTVERSION}" ]
  then
    ERRORS="jail '${jail}' is ${JAILVERSION}"
  fi
done

if [ "${ERRORS}" == "" ]
then
  echo 'All jails match the host'
  exit 0
else
  echo "WARNING: HOST and jails are NOT in sync: host = ${HOSTVERSION} but ${ERRORS}"
  exit 2
fi
[dan@x8dtu:/var/log] $ /usr/local/sbin/iocage list | /usr/bin/egrep -v '^JID' | /usr/bin/cut -f 2 -w
bash: /usr/local/sbin/iocage: No such file or directory
[dan@x8dtu:/var/log] $ /usr/local/sbin/iocage list | /usr/bin/egrep -v '^JID' | /usr/bin/cut -f 2 -wwhic^C
[dan@x8dtu:/var/log] $ which iocage
/usr/local/bin/iocage
[dan@x8dtu:/var/log] $
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-03-01 13:58 dvl New Issue