GNUPLOTING issue


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting GNUPLOTING issue
# 1  
Old 01-12-2015
GNUPLOTING issue

Need assistance in troubleshooting

I have written a script using GNUPLOT . It works great when i run manually but when i put in crontab it give me library file missing. Any inputs are highly appreciated.

Code:
#!/local/tools/monitoring/gnuplot-new/bin/gnuplot

set terminal png size 1024,768
set output 'graph.png'
set title "System monitoring"
set xlabel "time"
set key outside bottom
set ylabel "%"
set ytics format '%s%c'
set yrange [1:1024**2]
set autoscale
set grid
set xdata time
set format x "%H:%M"
set timefmt "%d-%m %H:%M:%S"
set ylabel "GB"
plot "testmemory.csv" using 1:3 title "used" with lines,\
"testmemory.csv" using 1:4 title "buffered" with lines,\
"testmemory.csv" using 1:5 title "cached" with lines,\
"testmemory.csv" using 1:6 title "free" with lines

When run through crontab this gives me below error.
Code:
gnuplot: error while loading shared libraries: libwx_gtk2u_xrc-3.0.so.0: cannot open shared object file: No such file
 or directory

# 2  
Old 01-12-2015
Well, where is this file located on your system?
# 3  
Old 01-12-2015
In scripts I run with cron I add a line like this...
Code:
# Because cron doesn't run in your local environs
source $HOME/.bash_profile >&/dev/null

You could try something like -- export PATH=$PATH:/your/libs/path
# 4  
Old 01-12-2015
My shell is tcsh .



It is located not in the user directory in a different /var/tmp location .

---------- Post updated at 12:54 PM ---------- Previous update was at 12:44 PM ----------

ongoto: I dont have a .bash_profile under the $HOME directory.

GNUPLOT doesnt have a lib directory to export.

Code:
drwxrwxr-x. 2 weather weather 4096 Jan 12 17:26 bin
drwxrwxr-x. 3 weather weather 4096 Jan 12 17:26 libexec
drwxrwxr-x. 5 weather weather 4096 Jan 12 17:26 share

# 5  
Old 01-12-2015
Quote:
When run through crontab this gives me below error.
Code:
gnuplot: error while loading shared libraries: libwx_gtk2u_xrc-3.0.so.0: cannot open shared object file: No such file
 or directory

OK. I see you are using tcsh.
If you can locate libwx_gtk2u_xrc-3.0.so.0 on your system (as Corona688 posted earlier), I was thinking you could add the path to that file in the PATH env variable, and then export it from within your script. If you can't locate that lib file, then you have other issues with gnuplot itself or your distro.

Have you tested running your script directly ( not using cron )?

Last edited by ongoto; 01-12-2015 at 03:22 PM..
# 6  
Old 01-12-2015
ongoto

running directly works without any errors .

Gnuplot doesnt have a lib directory. This lib file is located with other application called wx-widgets . That was also exported under .cshrc file . Gnuplot uses wx-widgets as well.
# 7  
Old 01-12-2015
OK. Then it's a cron issue.
It's not about libwx_gtk2u_xrc-3.0.so belonging to gnuplot. It's a library shared by lots of applications like you said.
So I say again...help cron find the shared library file. Cron runs in a very minimal
environment and doesn't know where to search for files needed by other applications. Gnuplot will be running as a child process of Cron and will be running in Cron's 'blind' environment.
You'll have to edit your script and see if this works or not.
On my system this file is in /usr/lib64
Code:
#!/local/tools/monitoring/gnuplot-new/bin/gnuplot

export PATH="$PATH:/usr/lib?"     ## the directory where you found libwx_gtk2u_xrc-3.0.so.

set terminal png size 1024,768
set output 'graph.png'
...
...


Last edited by ongoto; 01-12-2015 at 05:48 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue with wc -c and wc -m

Hi All, I have a small queries to get the character count i tried with wc -c and wc -m but its not returend current result For eg: wc -c wc -m echo "Name" | wc -c result: 5 but actually it should returned 4 Help me on this to ge the correct one. Thanks! ----------... (4 Replies)
Discussion started by: siva.pitchai
4 Replies

2. Shell Programming and Scripting

What could be the issue ?

Hi, when i am trying below script assume that below values are taken in code #!/bin/ksh if then echo usage: aNlist.sh QMGR NAME MQREQ fi NL=`echo 'dis qmgr'|runmqsc $1|grep REPOSNL|sed 's/.*REPOSNL\(.*\).*/\1/' |cut -d'(' -f2|cut -d')' -f1` echo 'define nl('$NL_$2')... (25 Replies)
Discussion started by: darling
25 Replies

3. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies

4. Shell Programming and Scripting

Need assistance with a file issue and a terminal issue

Hello everyone, I'm in need of some assistance. I'm currently enrolled in an introductory UNIX shell programming course and, well halfway through the semester, we are receiving our first actual assignment. I've somewhat realized now that I've fallen behind, and I'm working to get caught up, but for... (1 Reply)
Discussion started by: MrMagoo22
1 Replies

5. Shell Programming and Scripting

CP Issue

I want to copy large amount of files aproximately more than 20,000 files from one file system to another file system, but it gives me error like: #cd /opt/appserver/images #cp * /opt/appserver02/public/images Argument list is too long Also above mention error appear again when i run: ... (1 Reply)
Discussion started by: telnor
1 Replies

6. Solaris

IP issue

hi , I have a Solaris server which is part of a domain. The IP for this Solaris box is allocated dyanamically by a DHCP. Everytime the solaris box is restarted the IP gets changed. Being an admin what should i do to find the new ip of the Solaris server sitting at my location? Till now i get... (2 Replies)
Discussion started by: BalajiUthira
2 Replies

7. UNIX for Dummies Questions & Answers

ISSUE and ISSUE.NET files

In LINUX(CentOS, RedHat) is there a way to have the banner statement appear before the logon instead of after the logon? In UNIX and Windows the banner appears before a person actually logs on, what I'm seeing in LINUX is that it appears after the login(ftp, telnet, SSH). Thanks (0 Replies)
Discussion started by: ejjones
0 Replies

8. Shell Programming and Scripting

hi all please help me in this issue.

Hi all, I am very new to shell scripting.I have the requirement like one program is there, if it is running leave like that only and if it is stopped it has to be restart and once again keep watching and it is stopped we a have to restart once agian.I want a shell script for this.Please help me... (10 Replies)
Discussion started by: bhas85
10 Replies

9. Shell Programming and Scripting

Unix Arithmatic operation issue , datatype issue

Hi, I have a shell scripting. This will take 7 digit number in each line and add 7 digit number with next subsequent lines ( normal addition ). Eg: 0000001 0000220 0001235 0000022 0000023 ........... ......... ........ Like this i am having around 1500000 records. After adding... (23 Replies)
Discussion started by: thambi
23 Replies

10. UNIX for Dummies Questions & Answers

ps issue

HI All, Suddenly don't know what happened to redhat linux 7.2 any program start then itsn't listing while using ps -ef ex: ./xyz this xyz program pid not showing in ps-ef Pls let me know what is the reason for the same. Thanks a lot in advance Bache (7 Replies)
Discussion started by: bache_gowda
7 Replies
Login or Register to Ask a Question