Unix Technical Forum

Jonathan Schilling: Get system data problem in Java

This is a discussion on Jonathan Schilling: Get system data problem in Java within the Sco Unix forums, part of the Unix Operating Systems category; --> I need to get the serial number (3aannnnnn) of a SCO 5.0.x or 6.0.x enterprise system in Java. I ...


Go Back   Unix Technical Forum > Unix Operating Systems > Sco Unix

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-15-2008, 05:40 PM
carl@eatontown.net
 
Posts: n/a
Default Jonathan Schilling: Get system data problem in Java

I need to get the serial number (3aannnnnn)
of a SCO 5.0.x or 6.0.x enterprise system
in Java.

I can get some info in Java such as:
System.getProperty("os.name"));
However, the serial number System.getProperty eludes me.

I can do it in C with:
strncpy(sys_ser, unamedata.sysserial, 10);

Is there a way to get the serial number in Java direct?

Or, can I do some sort of system call to do a:
"uname -X > myfile" and open the myfile
as a properties file?

Or, can I call/link a C program as a subroutine
(I assume using a getsn.o file) of Java?

Any ideas would be appreciated.



Carl

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 05:40 PM
Rob
 
Posts: n/a
Default Re: Jonathan Schilling: Get system data problem in Java

carl@eatontown.net wrote:
> I need to get the serial number (3aannnnnn)
> of a SCO 5.0.x or 6.0.x enterprise system
> in Java.
>
> I can get some info in Java such as:
> System.getProperty("os.name"));
> However, the serial number System.getProperty eludes me.
>
> I can do it in C with:
> strncpy(sys_ser, unamedata.sysserial, 10);
>
> Is there a way to get the serial number in Java direct?
>
> Or, can I do some sort of system call to do a:
> "uname -X > myfile" and open the myfile
> as a properties file?
>
> Or, can I call/link a C program as a subroutine
> (I assume using a getsn.o file) of Java?
>
> Any ideas would be appreciated.
>
>
>
> Carl
>


From the system/shell point of view on SCO OS 5.0.x:

grep IQM_ACTIVATION_KEY /var/adm/ISL/iqm_file
grep IQM_SERIAL_NUMBER /var/adm/ISL/iqm_file

For 6.0.0, haven't tried yet :-(

--
Roberto Zini - r.zini<@AT@>strhold.it
---------------------------------------------------------------------
"Has anybody around here seen an aircraft carrier?"
(Pete "Maverick" Mitchell - Top Gun)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-15-2008, 05:41 PM
jlselsewhere@my-deja.com
 
Posts: n/a
Default Re: Get system data problem in Java

carl@eatontown.net wrote:
> I need to get the serial number (3aannnnnn)
> of a SCO 5.0.x or 6.0.x enterprise system
> in Java.
>
> I can get some info in Java such as:
> System.getProperty("os.name"));
> However, the serial number System.getProperty eludes me.
>
> I can do it in C with:
> strncpy(sys_ser, unamedata.sysserial, 10);
>
> Is there a way to get the serial number in Java direct?
>
> Or, can I do some sort of system call to do a:
> "uname -X > myfile" and open the myfile
> as a properties file?
>
> Or, can I call/link a C program as a subroutine
> (I assume using a getsn.o file) of Java?


There's no way of doing it in pure Java.

Yes, you can call a C subprogram that gets it
(see the native methods discussion in
/usr/java/ReleaseNotes.html). If it's available
from some command, you can invoke that command
via the Runtime.getRuntime().exec(some_command)
facility.

Jonathan Schilling

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 05:41 PM
jdanskinner
 
Posts: n/a
Default Re: Get system data problem in Java


jlselsewhere@my-deja.com wrote:
> carl@eatontown.net wrote:
> > I need to get the serial number (3aannnnnn)
> > of a SCO 5.0.x or 6.0.x enterprise system
> > in Java.
> >
> > I can get some info in Java such as:
> > System.getProperty("os.name"));
> > However, the serial number System.getProperty eludes me.
> >
> > I can do it in C with:
> > strncpy(sys_ser, unamedata.sysserial, 10);
> >
> > Is there a way to get the serial number in Java direct?
> >
> > Or, can I do some sort of system call to do a:
> > "uname -X > myfile" and open the myfile
> > as a properties file?
> >
> > Or, can I call/link a C program as a subroutine
> > (I assume using a getsn.o file) of Java?

>
> There's no way of doing it in pure Java.
>
> Yes, you can call a C subprogram that gets it
> (see the native methods discussion in
> /usr/java/ReleaseNotes.html). If it's available
> from some command, you can invoke that command
> via the Runtime.getRuntime().exec(some_command)
> facility.
>
> Jonathan Schilling



uname -X | grep Serial | cut -d" " -f 3

Should give you the Serial number.

Regards...Dan.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:02 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com