Thread: Re: [Arsperl-users] Problem from web or cron
Brought to you by:
jeffmurphy
|
From: Thilo S. <thi...@ap...> - 2007-10-18 08:36:32
|
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.
>>>
>>
>>
>
|
|
From: Vaughan, M. <Mar...@ca...> - 2007-10-18 15:50:42
|
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: ars...@ar...
[mailto:ars...@ar...] 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,=20
see recent arsperl-users thread about date conversion for date fields).
Furthermore, it looks like '800006010' might be a selection field. If=20
this is the case, specify the corresponding integer values of "Problem"=20
and "Informational" here as well.
Regards,
Thilo Stapff
Brad O'Hara wrote:
> COMMAND LINE:
> Started at Wed Oct 17 14:35:00 EDT 2007
>=20
> after login errstr=3D><
> q=3D>('800006010' =3D "Problem" OR '800006010' =3D "Informational") =
AND=20
> '800000101' =3D "10/16/2007"<
> after load qual errstr=3D><
> qual=3D>ARQualifierStructPtr=3DSCALAR(0x89ae9b0)<
> after get list errstr=3D><
> number entries=3D>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
>=20
> CRON:
> Started at Wed Oct 17 14:43:02 EDT 2007
>=20
> after login errstr=3D><
> q=3D>('800006010' =3D "Problem" OR '800006010' =3D "Informational") =
AND=20
> '800000101' =3D "10/16/2007"<
> after load qual errstr=3D><
> qual=3D>ARQualifierStructPtr=3DSCALAR(0x98d8810)<
> after get list errstr=3D><
> number entries=3D>0<
>=20
> Thanks sooo much for your help! This is driving me crazy. Notice I
get=20
> logged in and the qualifier is built fine, but I get no entries. I=20
> attached the entire script if that helps.
>=20
> Brad
>=20
> Thilo Stapff wrote:
>> Would it be possible to insert some debug statements to see how far
it=20
>> 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=20
>> 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=20
>>> 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=20
>>> retrieves entries when run from the command line, but not from a=20
>>> crontab entry.
>>>
>>> my $c =3D ars_Login(&CCACHE::SERVER, &CCACHE::USERNAME,=20
>>> &CCACHE::PASSWORD);
>>> my $query =3D qq/('800006010' =3D "Problem" OR '800006010' =3D=20
>>> "Informational") AND '800000101' =3D "$date"/;
>>>
>>> ($qual =3D ars_LoadQualifier($c, $schema, $query));
>>>
>>> # Get Requests
>>> my (%entries =3D 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=20
>>> $ENV{'PATH'} =3D to the same as the shell path.
>>>
>>> Any help is greatly appreciated.
>>>
>>
>>
>=20
------------------------------------------------------------------------
-
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
Ars...@ar...
https://lists.sourceforge.net/lists/listinfo/arsperl-users
|
|
From: Brad O'H. <br...@uf...> - 2007-10-20 07:30:50
|
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: ars...@ar...
> [mailto:ars...@ar...] 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
> Ars...@ar...
> 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
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
>
>
--
Brad O'Hara E-mail: br...@uf...
IT Expert Voice: (352)392-2061
Computing and Networking Services Suncom: 622-2061
University of Florida Fax: (352)392-9440
|