Clickpack - Routine CPIPToDomain

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pnpmarques
Participant
Posts: 35
Joined: Wed Jun 15, 2005 9:27 am

Clickpack - Routine CPIPToDomain

Post by pnpmarques »

Hello,
I'm working with Clickpack to treat weblogs. I am trying to convert an IP adress to a domain using routine CPIPToDomain. The problem is that it doesn't do any conversion (Testing returns nothing, as well using it in a job).
I'll try to give you more information hoping that it helps you to help me:

There is no reference to it and I don't know much about its code but I believe that inside the routine, this line:
DScallPerl1("sub {my $ip = pack(N,$_[0]);$host = gethostbyaddr($ip,0); return $host; }","I",Key)
is calling the unix command nslookup.

If I execute the nslookup command like this:
/anydirectory/nslookup
I get:
bash: nslookup: command not found

I really have to put the whole path to get something:
/usr/sbin/nslookup 123.123.11.22
Name: name.company.pt
Address: 123.123.11.22


If I execute the nslookup command in a DS job (no path) a get this:
DSJobName..BeforeJob (ExecSH): Executed command: nslookup 123.123.11.22
*** Output from command was: ***
Server: name.company.pt
Address: 123.123.11.22

Do you think Clickpack is not well instaled or something is missing on the server configuration?
Thank You!
ferreirahe
Charter Member
Charter Member
Posts: 25
Joined: Wed Apr 09, 2003 12:58 pm

Re: Clickpack - Routine CPIPToDomain

Post by ferreirahe »

Hi Pedro,

It seems that the code snipet of the Clickpack CPIPToDomain routine you've posted has a wrong parameter regarding Solaris OS:

DScallPerl1("sub {my $ip = pack(N,$_[0]);$host = gethostbyaddr($ip,0); return $host; }","I",Key)

should be:

DScallPerl1("sub {my $ip = pack(N,$_[0]);$host = gethostbyaddr($ip,2); return $host; }","I",Key)

For some reason, the implementation of the gethostbyaddr(...) function only accepts the AF_INET protocol as 2, not 0. In Windows works both ways...who knows what will come next? :wink:

Cheers,
Henrique

pnpmarques wrote:Hello,
I'm working with Clickpack to treat weblogs. I am trying to convert an IP adress to a domain using routine CPIPToDomain. The problem is that it doesn't do any conversion (Testing returns nothing, as well using it in a job).
I'll try to give you more information hoping that it helps you to help me:

There is no reference to it and I don't know much about its code but I believe that inside the routine, this line:
DScallPerl1("sub {my $ip = pack(N,$_[0]);$host = gethostbyaddr($ip,0); return $host; }","I",Key)
is calling the unix command nslookup.

If I execute the nslookup command like this:
/anydirectory/nslookup
I get:
bash: nslookup: command not found

I really have to put the whole path to get something:
/usr/sbin/nslookup 123.123.11.22
Name: name.company.pt
Address: 123.123.11.22


If I execute the nslookup command in a DS job (no path) a get this:
DSJobName..BeforeJob (ExecSH): Executed command: nslookup 123.123.11.22
*** Output from command was: ***
Server: name.company.pt
Address: 123.123.11.22

Do you think Clickpack is not well instaled or something is missing on the server configuration?
Thank You!
Post Reply