View Issue Details

IDProjectCategoryView StatusLast Update
0000054My infrastructureGeneralpublic2022-08-15 10:22
Reporterdvl Assigned Todvl  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
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

dvl

2022-08-15 10:22

manager   ~0000170

iocage is no longer used

Issue History

Date Modified Username Field Change
2019-03-01 13:58 dvl New Issue
2022-08-15 10:22 dvl Assigned To => dvl
2022-08-15 10:22 dvl Status new => closed
2022-08-15 10:22 dvl Resolution open => fixed
2022-08-15 10:22 dvl Note Added: 0000170