echo $var give 0 value in the graph

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
psynomad
Posts: 4
Joined: Mon Apr 14, 2008 7:30 am

echo $var give 0 value in the graph

Post by psynomad »

hi every body
i write a script:
var=`grep '^2008-03-14 15:21:4[0-9]................................SendMessageRequest' /root/Desktop/event.log-14-03-2008/event.log | wc -l`
echo $var

whene i execute the script in linecommand i have the result 8 of the script
they calculate a number of line result by grep
the probléme is that in cacti graph i have 0 value in the graph
i try to make echo 8 i have 8 in the graph but echo $var gives 0
i don't now where is the problem
please any help
excuse my english
buck
Posts: 17
Joined: Tue Sep 04, 2007 10:09 am

Post by buck »

start by using:

/bin/grep

and

/usr/bin/wc
psynomad
Posts: 4
Joined: Mon Apr 14, 2008 7:30 am

Post by psynomad »

thanks buck for replying
i think the problem is not in my script bcause whene i run it in console he return a good anser but whene the script is run by cacti he return always 0 value
i think the problém is in the returned value for cacti or somewhere in cacti configuration but i don't now exactly where
thanks for your help
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Buck may be correct. cactiuser will not have a full shell environment when called from crontab. So don't rely on $PATH
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests