Mark,

  Thilo was polite enough to answer an email directly to him, below is 
his suggestion:

You might try the following:

Assuming that '800000101' is a date or date/time field, specify the date 
in the qualifier string as an integer (epoch time for date/time fields, 
see recent arsperl-users thread about date conversion for date fields).

Furthermore, it looks like '800006010' might be a selection field. If 
this is the case, specify the corresponding integer values of "Problem" 
and "Informational" here as well.

my $date    = '10/19/2007';
my $query    = qq/('Ticket Type' = "Problem" OR 'Ticket Type' = 
"Informational") AND 'Log Date' = "$date"/;

my $remdate =  (int( $epoch_time / 86400 ) + 2440588) - 1;
my $query    = qq/('800006010' = "Problem" OR '800006010' = "Informational") 
AND '800000101' = $remdate/;

For some reason, from the command line the first query gets converted to an 
integer but from cron job it does not.  Could it be a path problem to ARS.so?

Anyway, thanks to Thilo it is working if I convert the date.  Thanks very much!

Brad



Vaughan, Mark wrote:
> Have you verified that you are logging in to ARS as the same user?
>
> As a test, try changing your qual in the cron to directly select one of
> those records that shows up interactively.
>
> Mark Vaughan
> TTS Development
> Comcast Cable Corporation
> 720.268.8591
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Thilo Stapff
> Sent: Thursday, October 18, 2007 2:36 AM
> To: Brad O'Hara; ARSperl User Discussion
> Subject: Re: [Arsperl-users] Problem from web or cron
>
> You might try the following:
>
> Assuming that '800000101' is a date or date/time field, specify the date
>
> in the qualifier string as an integer (epoch time for date/time fields, 
> see recent arsperl-users thread about date conversion for date fields).
>
> Furthermore, it looks like '800006010' might be a selection field. If 
> this is the case, specify the corresponding integer values of "Problem" 
> and "Informational" here as well.
>
>
> Regards,
> Thilo Stapff
>
>
> Brad O'Hara wrote:
>   
>> COMMAND LINE:
>> Started at Wed Oct 17 14:35:00 EDT 2007
>>
>> after login errstr=><
>> q=>('800006010' = "Problem" OR '800006010' = "Informational") AND 
>> '800000101' = "10/16/2007"<
>> after load qual errstr=><
>> qual=>ARQualifierStructPtr=SCALAR(0x89ae9b0)<
>> after get list errstr=><
>> number entries=>19<
>> CNS-00000000061
>> CNS-00000000062
>> CNS-00000000063
>> CNS-00000000064
>> CNS-00000000065
>> CNS-00000000066
>> CNS-00000000067
>> CNS-00000000068
>> CNS-00000000069
>> CNS-00000000070
>> CNS-00000000071
>> CNS-00000000072
>> CNS-00000000073
>> CNS-00000000075
>> CNS-00000000076
>> CNS-00000000077
>> CNS-00000000078
>> CNS-00000000079
>> CNS-00000000080
>>
>> CRON:
>> Started at Wed Oct 17 14:43:02 EDT 2007
>>
>> after login errstr=><
>> q=>('800006010' = "Problem" OR '800006010' = "Informational") AND 
>> '800000101' = "10/16/2007"<
>> after load qual errstr=><
>> qual=>ARQualifierStructPtr=SCALAR(0x98d8810)<
>> after get list errstr=><
>> number entries=>0<
>>
>> Thanks sooo much for your help!  This is driving me crazy.  Notice I
>>     
> get 
>   
>> logged in and the qualifier is built fine, but I get no entries.  I 
>> attached the entire script if that helps.
>>
>> Brad
>>
>> Thilo Stapff wrote:
>>     
>>> Would it be possible to insert some debug statements to see how far
>>>       
> it 
>   
>>> gets (especially checking for $ars_errstr after every ARS API call)?
>>>
>>> I don't know where the output from cron jobs goes, but there should
>>>       
> be 
>   
>>> a log file for this. Or maybe the output can be explicitly redirected
>>>       
>
>   
>>> in the cron job definition?
>>>
>>> Do you know if the script gets started at all?
>>>
>>>
>>> Regards,
>>> Thilo Stapff
>>>
>>>
>>> Brad O'Hara wrote:
>>>       
>>>> Sorry to bother you directly, I posted this to the list without a 
>>>> response :-( and noticed you answer most questions.
>>>> I am using ARSperl 1.90 against a v7.01 server.
>>>>
>>>> Not sure what I am doing wrong!  I have the following code that 
>>>> retrieves entries when run from the command line, but not from a 
>>>> crontab entry.
>>>>
>>>> my $c = ars_Login(&CCACHE::SERVER, &CCACHE::USERNAME, 
>>>> &CCACHE::PASSWORD);
>>>> my $query    = qq/('800006010' = "Problem" OR '800006010' = 
>>>> "Informational") AND '800000101' = "$date"/;
>>>>
>>>> ($qual = ars_LoadQualifier($c, $schema, $query));
>>>>
>>>> # Get Requests
>>>> my (%entries = ars_GetListEntry($c, $schema, $qual, 0, 0)) ;
>>>>
>>>> if ( %entries ) {
>>>>  my (%values, %ticket);
>>>>  foreach $entry_id (sort keys %entries) {
>>>>  }
>>>> }
>>>> else { #nothing returned }
>>>>
>>>> The only thing I could think of was a path difference, however, I
>>>>         
> set 
>   
>>>> $ENV{'PATH'} = to the same as the shell path.
>>>>
>>>> Any help is greatly appreciated.
>>>>
>>>>         
>>>       
>
>
> ------------------------------------------------------------------------
> -
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Arsperl-users mailing list
> Arsperl-users@arsperl.org
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Arsperl-users mailing list
> Arsperl-users@arsperl.org
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
>
>   

-- 
Brad O'Hara                         E-mail:  [EMAIL PROTECTED]
IT Expert                            Voice: (352)392-2061
Computing and Networking Services   Suncom: 622-2061
University of Florida                  Fax: (352)392-9440


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Arsperl-users mailing list
Arsperl-users@arsperl.org
https://lists.sourceforge.net/lists/listinfo/arsperl-users

Reply via email to