How do you retrieve hostname/PMID within a tuxedo program?

Is there a means of obtaining the PMID within a Tuxedo server program (similar to "proc_name" for the program name)? I need to retrieve the value of the uname that appears in ULOG, which is either the hostname or the name set by the PMID environment variable.
Thanks & regards,
Malcolm.

Code for get the PMID:
#define MACHINE_PMID_LEN 30
#define MAXBUFF_LEN 16384
char *getPMID()
FBFR32 ibuf = (FBFR32 )NULL;
FBFR32 obuf = (FBFR32 )NULL;
long filter;
long flags;
long olen;
int i = 0;
char *pmid;
FLDLEN32 pmid_maxlen = MACHINE_PMID_LEN + 1;
int ret;
pmid = (char*)malloc(MACHINE_PMID_LEN + 1);
if(pmid == (char*)NULL) {
fprintf(stdout, "getPMID::Error malloc.\n");
return((char*)NULL);
** Reserva espacio para buffer de entrada a las funciones de la MIB.
ibuf = (FBFR32 *)tpalloc("FML32", NULL, MAXBUFF_LEN);
if(ibuf == (FBFR32 *)NULL) {
fprintf(stdout, "getPMID::Error tpalloc ibuf(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
ret = Finit32(ibuf, MAXBUFF_LEN);
if(ret == -1){
fprintf(stdout, "getPMID::Error Finit32 ibuf(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
** Reserva de espacio para buffer de salida de las funciones de la MIB.
obuf = (FBFR32 *)tpalloc("FML32", NULL, MAXBUFF_LEN);
if(obuf == (FBFR32 *)NULL){
fprintf(stdout, "getPMID::Error tpalloc obuf(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
ret = Finit32(obuf, MAXBUFF_LEN);
if(ret == -1){
fprintf(stdout, "getPMID::Error Finit32 obuf(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
** Tipo de Operacion -> Obtencion de informacion.
if(Fchg32(ibuf, TA_OPERATION, 0, "GET", 0) == -1){
fprintf(stdout, "getPMID::Error setting TA_OPERATION(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
** Clase del objeto del que se solicita la informacion.
if(Fchg32(ibuf, TA_CLASS, 0, "T_MACHINE", 0) == -1){
fprintf(stdout, "getPMID::Error setting TA_CLASS(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
** Componente de informacion a obtener(todos).
** Al no especificar filtro se obtienen todos
** los componentes.
filter = TA_PMID ;
if(Fchg32(ibuf, TA_FILTER, -1, (char *)&filter, 0) == -1){
fprintf(stdout, "getPMID::Error setting TA_FILTER(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
** Hacemos efectiva la consulta construida en ibuf,
** obteniendo la respuesta en obuf.
if(tpcall(".TMIB", (char *)ibuf, 0, (char **)&obuf, &olen, 0) == -1) {
fprintf(stdout, "getPMID::Error calling servide .TMIB(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
** Obtencion del identificador(PMID).
pmid_maxlen = MACHINE_PMID_LEN+1;
if(Fget32(obuf, TA_PMID, i, (char *)pmid, &pmid_maxlen) == -1) {
fprintf(stdout, "getPMID::Error getting TA_PMID(%s).\n", tpstrerror(tperrno));
return((char*)NULL);
** Liberacion de buffers utilizados y que
** ya no son necesarios.
tpfree((char *)ibuf);
tpfree((char *)obuf);
** Si hemos llegado a este momento es p.q. todo ha transcurrido
** correctamente por lo que retornamos el numero de servidores
** obtenidos.
return(pmid);
} /* getPMID */
To get the PMID you must use the getPMID function:
** Conexion al System/T como proceso cliente.
fprintf(stdout, "%s::Estableciendo conexion con System/T.\n", argv[0]);
ret = tpinit(tpinfo);
if(ret == -1) {
fprintf(stderr, "%s::Fallo en inicio conexion con System/T(%s).\n", argv[0], tpstrerror(tperrno));
exit(EXIT_FAILURE);
pmid = (char*)getPMID();
fprintf(stdout, "%s::Physical Machine ID: [%s].\n", argv[0], pmid?pmid:"(null)");
Regards.

Similar Messages

  • How do you retrieve a built in app that was never originally installed on my iPod?

    How do you retrieve a built in app that was never originally installed on my ipod?  It's for the iMessages app.  The iPod doesn't reference messaging at all.  I purchased 2 for Christmas within the same purchase yet one has the app and the other does not...Can you help?

    Have they both been upgraded to iOS 5?
    Stedman

  • After upgrading software to 5.0, I lost my Contact List. How do you retrieve it.

    After upgrading software to 5.0, I lost my Contact List. How do you retrieve it.

    Prodesigntools.com , go ahead and download the software from there and use your serial number to serialize it.

  • How do you retrieve old voicemail messages?

    I can't get my old voicemail after the voicemail upgrade.  How do you retrieve old messages?

    is there a way to look at old text messages that were saved during backup to itunes/icloud.  I don't necessarily want them back on my phone and don't want to loose the text messages on my phone now.  Can they be saved to a different file on my computer from itunes so they can be printed out.

  • How do you retrieve the USR_LOCK value?

    How do you retrieve the USR_LOCK value, it cant be mapped directly on the process task right?
    You writed custom JAVA code?
    Thanks in advance.

    If by any change you want this with 11g APIs then you can use http://docs.oracle.com/cd/E14571_01/apirefs.1111/e17334/oracle/iam/identity/usermgmt/vo/User.html#getManuallyLocked__ and http://docs.oracle.com/cd/E14571_01/apirefs.1111/e17334/oracle/iam/identity/usermgmt/vo/User.html#getAccountLockedDate__
    HTH,
    Bikash

  • How do you retrieve a Collection of objects using JDBC?

    How do you retrieve a Collection of objects using JDBC.
    MORE INFO:
    I have created a class i.e. Account class and I want to retrieve all the accounts previously created for accounts in my Mysql database..
    my method would retrieve an array of Account instances in the database i.e.
    public Vector retrieveAccounts();

    Connection con = null;
    ArrayList accounts = new ArrayList();
    try{
      con = DriverManager.getConnection(...);
      PreparedStatement ps = con.prepareStatement("select * from accounts");
      Resultset rs = ps.executeQuery();
      while (rs.next()) {
        Account account = new Account(rs.getString(1), rs.getString(2), ...);
        accounts.add(account);
      Account[] account_array = new Account[accounts.size()];
      accounts.toArray(account_array);
    catch (SQLException sqle) {
       sqle.printStackTrace();
    finally {
      if (con != null) {
        con.close();
    }should pretty much to what you want, you will obviously need to change it so that, a) the SQL query is correct and b) the Account class is correct and c) the correct values are taken from the result set to create an account.

  • How do you retrieve a dropped table in 11i?

    How do you retrieve a dropped table in 11i?

    Hi,
    You posted your question on the wrong forum. Please re-post it on the following one: http://forums.oracle.com/forums/category.jspa?categoryID=18
    However, you have to use the flashback technology.
    e.i: FLASHBACK TABLE .......TO TIMESTAMP ('date');
    Regards,
    Fred

  • How do you retrieve a forgetten restrictions passcode

    how do you retrieve a forgetten restrictions passcode

    That's a tough one.  I've not had to do it but I've read it can be done.  See this thread... https://discussions.apple.com/message/20544884#20544884
    Also, look to your right under "More Like This" for related discussions. ---->

  • How do you retrieve a password when your Ipod say's connect to ITunes, but when you go on ITunes it says to unlock password?

    How do you retrieve a password when your Ipod say's connect to ITunes, but when you go on ITunes it says to unlock password?

    You will need to do this:
    iOS: Unable to update or restore

  • How do you retrieve deleted text messages from icloud

    How do you retrieve deleted text messages from icloud?

    Hope this helps
    I hope you created an iCloud backup.
    Here is what the iCloud backup can have in it.
    iCloud: iCloud storage and backup overview
    http://support.apple.com/kb/PH12519
    Good hunting

  • TS2972 How do you move your music within itunes from your regular library to the homeshares library so that you can import it to your new computer?

    How do you move your music within itunes from your regular library to the homeshares library so that you can import it to your new computer?

    You do not have to move it as such. Here are the steps to setup HomeSharing
    1) Ctrl B to turn on the top menu
    2) File > Home Sharing > Create Home Share enter your apple id and password, click create
    3) repeat steps 1 and 2 for the other computer and create home share using the same apple id and password
    On your new machine if you have turned on the left hand sidebar the Shared Library should be about halfway down like this.
    Select the songs you want and click import at the bottom right. If you want all songs then I would select one song nad Ctrl A to select all
    Finally if you have a lot of songs to transfer Switch off the wifi on the old computer. Leave the wifi on the new one. Connect with an ehternet network cable. The copying speed is way faster.
    Click import and grab a coffee

  • How do you retrieve your music from I cloud?

    How do you retrieve your music from I cloud?

    If you mean redownloading purchased music, see http://support.apple.com/kb/HT2519.

  • How do you access attachments embedded within survey results?

    How do you access attachments embedded within survey results?

    This is a tutorial explaining attachments:
    http://forums.adobe.com/docs/DOC-2656

  • HT201304 How do you retrieve a forgotten passcode?

    How do you retrieve a forgotten passcode? 

    Same:
    Forgotten Screen-Lock Passcode
    Connect the iOS device to your computer and try to make a backup
    iOS: How to back up
    Then restore via iTunes. The iOS device will be erased. Place the iOS device in Recovery Mode if necessary to allow the restore.
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store   
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.

  • HT1911 how can you retrieve your passcode for your ipod if you have forgotten it?

    how can you retrieve your passcode for your ipod touch if you have forgotten it and it became disabled?

    You cannot retrieve it.
    You can do as the manual tells you to do and restore the ipod.
    If you are unable to restore, then type "unable to restore" into the search bar at the top of this page by Support and read the resulting help articles.

Maybe you are looking for