HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: //var/opt/OV/bin/instrumentation/check-cron.sh
#!/bin/bash

date=`date +%d%m%y%H%M`
prog_name=`basename ${0}`
dir_name=`dirname ${0}`

OPCMON=/opt/OV/bin/opcmon
mon_name=OS-LX-CronProcessMonitor-Level3

VERSION=`cat /proc/version`

if [[ "$VERSION" =~ "Red Hat" ]]
then
	OS="Red Hat"
	proc=crond
elif [[ "$VERSION" =~ "SUSE" ]]
then 
	OS=SuSE
	proc=cron
elif [[ "$VERSION" =~ "Debian" ]]
then
	OS=Debian
	proc=cron
elif [[ "$VERSION" =~ "centos" ]]
then
	OS=CentOS
	proc=crond
elif [[ "$VERSION" =~ "Ubuntu" ]]
then
	OS=Ubuntu
	proc=cron
fi

	CantidadDeProcesosCron=` ps -ef | grep -e "[ /]$proc" -e "[ /]$proc -.*" | grep -v grep | grep -v $prog_name | wc -l `
	if [ $? != 0 ]
        then
	CantidadDeProcesosCron=0
	fi

        $OPCMON $mon_name=$CantidadDeProcesosCron -object $proc
exit 0