Re: [rt-users] Cron Issues....
At Wednesday 7/11/2007 12:06 PM, Jeff Stark wrote: Hello everyone... RT 3.6.3, RHEL, Oracle DB. I have a cron job I created in cron.hourly...its pretty simplistic and the command works great when I run it directly. Being very new to Linux, I was hoping one of you may notice something simple that I am missing here. #!/bin/sh /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL --search-arg ( Status = 'new' OR Status = 'open' OR Status = 'stalled' ) AND ( 'CF.{Severity Level}' LIKE 'Sev 2 (Premier Support ONLY)' ) AND ( 'CF.{Customer}' NOT LIKE '%(p)' AND 'CF.{Customer}' NOT LIKE '%(ep)' ) --action RT::Action::DemotePremierLevel Thanks, -Stark Do you have any output from a cron run of this? It could be that the cron invocation is not getting the Oracle environment variables it needs. Steve ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
RE: [rt-users] Cron Issues....
The only item in /var/log/cron is: Jul 11 09:01:01 infrt01 crond[23295]: (root) CMD (run-parts /etc/cron.hourly) Is there somewhere else I should look? Thanks, -Stark -Original Message- From: Stephen Turner [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 12:22 PM To: Jeff Stark; RT Users Subject: Re: [rt-users] Cron Issues At Wednesday 7/11/2007 12:06 PM, Jeff Stark wrote: Hello everyone... RT 3.6.3, RHEL, Oracle DB. I have a cron job I created in cron.hourly...its pretty simplistic and the command works great when I run it directly. Being very new to Linux, I was hoping one of you may notice something simple that I am missing here. #!/bin/sh /opt/rt3/bin/rt-crontool --search RT::Search::FromSQL --search-arg ( Status = 'new' OR Status = 'open' OR Status = 'stalled' ) AND ( 'CF.{Severity Level}' LIKE 'Sev 2 (Premier Support ONLY)' ) AND ( 'CF.{Customer}' NOT LIKE '%(p)' AND 'CF.{Customer}' NOT LIKE '%(ep)' ) --action RT::Action::DemotePremierLevel Thanks, -Stark Do you have any output from a cron run of this? It could be that the cron invocation is not getting the Oracle environment variables it needs. Steve ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
RE: [rt-users] Cron Issues....
Excellent! Had no idea...you are correct, it is Oracle Connectivity that is causing the issue. Any ideas how I solve this? I used the priority escalation script as a template. /etc/cron.hourly/RT-DemotePremier.cron: Unable to load DBIx::SearchBuilder database handle for 'Oracle'. Perhaps you've picked an invalid database type or spelled it incorrectly. Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Orac le/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared obje ct file: No such file or directory at /usr/lib/perl5/5.8.5/i386-linux-thread-mul ti/DynaLoader.pm line 230. at /usr/lib/perl5/site_perl/5.8.5/DBIx/SearchBuilder/Handle/Oracle.pm line 6 Compilation failed in require at /usr/lib/perl5/site_perl/5.8.5/DBIx/SearchBuild er/Handle/Oracle.pm line 6. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.5/DBIx/SearchB uilder/Handle/Oracle.pm line 6. Compilation failed in require at (eval 207) line 1. BEGIN failed--compilation aborted at (eval 207) line 1. Compilation failed in require at /opt/rt3/lib/RT.pm line 201. -Original Message- From: Stephen Turner [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 12:57 PM To: Jeff Stark; RT Users Subject: RE: [rt-users] Cron Issues At Wednesday 7/11/2007 12:37 PM, Jeff Stark wrote: The only item in /var/log/cron is: Jul 11 09:01:01 infrt01 crond[23295]: (root) CMD (run-parts /etc/cron.hourly) Is there somewhere else I should look? Thanks, -Stark I think any output (stdout or stderr) from the cron job that isn't explicitly redirected is mailed to the crontab owner. So there may be a mail message that contains a clue. Steve ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
RE: [rt-users] Cron Issues....
At Wednesday 7/11/2007 02:15 PM, Jeff Stark wrote: Yes, that is defined. I have tried adding .bash_profile to my script...see if that works It's been a long while since I dealt with this issue, but I used to have a file I called ~/.oracle, which set all the Oracle-related env variables. I sourced this from my shell start up file (e.g. .bashrc) and also in each crontab entry that needed Oracle access. That way I was sure that both command-line and cron jobs were getting the same Oracle environment. Steve ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
RE: RE: [rt-users] Cron Issues....
Thanks, yes, actually I am expecting it to run as root. (I know bad karma to follow) But I am just trying to get it working. I have tried forcing the loading of .bash_profile and have also tried adding the following to the script: export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/client_1 export LD_LIBRARY_PATH=$ORACLE_HOME/lib But I still get this error: Unable to load DBIx::SearchBuilder database handle for 'Oracle'. Perhaps you've picked an invalid database type or spelled it incorrectly. Can't load '/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/DBD/Oracle/ Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230. at /usr/lib/perl5/site_perl/5.8.5/DBIx/SearchBuilder/Handle/Oracle.pm line 6 Compilation failed in require at /usr/lib/perl5/site_perl/5.8.5/DBIx/SearchBuilder/Handle/Oracle.pm line 6. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.5/DBIx/SearchBuilder/Handle/Oracle.pm line 6. Compilation failed in require at (eval 207) line 1. BEGIN failed--compilation aborted at (eval 207) line 1. Compilation failed in require at /opt/rt3/lib/RT.pm line 201. - Stark -Original Message- From: John BORIS [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 3:43 PM To: RT-Users@lists.bestpractical.com; [EMAIL PROTECTED]; Jeff Stark Subject: Re: RE: [rt-users] Cron Issues This might be trivial but make sure the job is running the job as the user you expect. If cron.hourly is being executed as root then it may be reading the wrong files to setup the environment. John J. Boris, Sr. JEN-A-SyS Administrator Archdiocese of Philadelphia 222 North 17th Street Philadelphia, Pa. 19103 Tel: 215-965-1714 Fax: 215-587-3525 Remember! That light at the end of the tunnel Just might be the headlight of an oncoming train! ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com