# Splunk event confusion

## J3N7iL

I am in progress of locking down my Gentoo server to get it ready for prime time,

I have a install of splunk collecting logs and I am doing some basic monitoring of my installed applications to ensure all is running well.

I came across this event and not sure why it is saying it cannot find mdadm:

 *Quote:*   

> 8/19/11
> 
> 12:30:03.000 AM 	
> 
> Aug 19 00:30:03 localhost sSMTP[25550]: sh: mdadm: command not found
> ...

 

I have a successful raid array running and mounted and holding my Apache virtual sites for 5 sites at the moment

I have one cron job that runs every 30 min

 *Quote:*   

> */30 * * * * /root/disktest.py

 

here is the script

 *Quote:*   

> 
> 
> #!/usr/bin/python
> 
> import os
> ...

 

When I run that command in a terminal it executes perfectly.

Can anyone figure out why I am getting " sh: mdadm: command not found"?

----------

## Hu

The cron job is probably run with a different $PATH.  For consistency, you should use a fully qualified path or set $PATH explicitly.  May I ask why you are using a Python script to do a job that could be trivially done in shell?  Additionally, why are you using grep here?

----------

## J3N7iL

Wow, long time no answer. Got busy

So I fixed the path to  /sbin/mdadm and it is working. Thanks for that tip.

Also I do everything in Python because I use python on a daily basis for work and find it easier to keep everything consistent.

All my automation, testing, log searching and web scrapping is done is Python and it's what I am most comfortable with so checking my disks just falls into that.

----------

