#!/bin/env bash

. /etc/nagios/keystonerc_admin

data=$(glance image-list --member-status all 2>&1)
rv=$?

if [ "$rv" != "0" ] ; then
    echo $data
    exit $rv
fi

echo "$data" | grep -v -e "^ID " -e "---------------" | wc -l
