1819941 Members
3526 Online
109607 Solutions
New Discussion юеВ

System uptime

 
SOLVED
Go to solution
Andr├й_12
New Member

System uptime

Firstly apologies for the brief question, secondly hello all.

I'm relatively new to VMS platforms and have been given a little project by my seniors, of which one of the task is to show the up time of our cluster (VMS V7.3-2 ). I'm at a total loss. Does anyone have any advice. Thaks for your help.

Andr
13 REPLIES 13
Kris Clippeleyr
Honored Contributor

Re: System uptime


Andre,

$ cf = F$GETSYI("CLUSTER_FTIME")
gives you the time the cluster was formed in symbol cf.
$ ct = F$TIME()
gives you the current time in symbol ct.
$ ut = F$DELTA_TIME(cf,ct)
gives you the difference in symbol ut.

Greetz,

Kris
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Bojan Nemec
Honored Contributor

Re: System uptime

Andr├Г┬й,

From DCL you simply do the next command:

$ WRITE SYS$OUTPUT F$GETSYI("CLUSTER_FTIME")

Boj
Andr├й_12
New Member

Re: System uptime

thanks for all your prompt answers. espically boj. I get a result from this command unlike the others (not sure if it's me or the system).

I thought i had answered my own question for a momemt by using "show system" as on the top line this displays a uptime message but on cross reference appears to be incorrect. is that the case??
Bojan Nemec
Honored Contributor
Solution

Re: System uptime

Andre,

The SHOW SYSTEM command gives you the system uptime which can be different for each cluster node. You can add /NOPROCESS to the SHOW SYSTEM
to avoid displaying all processes. The cluster_ftime gives you the cluster formation time. After that some nodes in the cluster can be rebooted but this time will remain the same since all cluster nodes are shut down.

Bojan
Bojan Nemec
Honored Contributor

Re: System uptime

Sorry,

Forgot to say that at the end of Kris commands you can do:
$ SHOW SYMBOL ut
or
$ WRITE SYS$OUTPUT ut
to see the cluster uptime. This gives you the delta time (uptime) of the cluster. My command gives you the date and time when the first system in the cluster was booted.

Bojan
Jan van den Ende
Honored Contributor

Re: System uptime

Andre,

... and just out of curiosity, what DOES your cluster uptime show?

.. and what is the reaction of your Micro$oft minded collegeas on that?


Cheers.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Kris Clippeleyr
Honored Contributor

Re: System uptime

Andre,


I get a result from this command unlike the others (not sure if it's me or the system).


Of course you get a result from Bojan's suggestion. That's because of the WRITE SYS$OUTPUT.
To have the results of my commands displayed, you could put them in a little command procedure like this:

$ cf = F$GETSYI("CLUSTER_FTIME")
$ ct = F$TIME()
$ ut = F$DELTA_TIME(cf,ct)
$ write sys$output "My cluster has an uptime of: " + ut

Call it e.g. UT.COM. And when you execute it (@UT), you 'll get something like:

My cluster has an uptime of: 50 17:10:37.62

Note: This is real data from the newest cluster I installed here on October 11, 2004.

Greetz,

Kris
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Martin Vorlaender
Honored Contributor

Re: System uptime

Hi,

another way is

$ SHOW CLUSTER /CONTINUOUS

and then (typing the first character without a prompt):

ADD TRANSITION_TIME
ADD FORMED

The former will give you the date each member entered the cluster, the last will give you the date the cluster was formed.

However, all of this only gives you dates, not delta times.

You can finish the command by Ctrl-Z or EXIT.

cu,
Martin
Jan van den Ende
Honored Contributor

Re: System uptime

Andre,

First, let me correct an omission be myself & colleagues:

WELCOME TO VMS!!


... and getting the uptimes of all nodes in the cluster:

$ show system/cluster/noprocess

... and I sincerely hope that you already found out about the HELP command. If not, just type
$ HELP
which will give further instructions.

It is a VERY good friend, even for those with double-digit years of experience!

hth,

Cheers.

Have one on me.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Ian Miller.
Honored Contributor

Re: System uptime

"SHOW SYSTEM/CLUSTER/NOPROC"
- I had not noticed that one before - I really do learn things here every day :-)

Note that this command shows the up time of each system in the cluster. (only 200 days for the system I looked at :-)
The cluster uptime can be longer and is given by the commands given in an earlier reply.
____________________
Purely Personal Opinion
Andr├й_12
New Member

Re: System uptime

Thanks to you you all for your responses. For all those interested "My cluster has an uptime of: 177 21:40:12.26"

Andr├Г
Bojan Nemec
Honored Contributor

Re: System uptime

Andre,

You can get this also in any VMS language, by calling apropriate system services. There is a C example:

#include
#include
#include

#include

int main ()
{
__int64 ftime;
__int64 now;
struct
{
unsigned short len;
unsigned short code;
__int64 * buff;
void * rlen;
unsigned long end;
} itmlst = {8,SYI$_CLUSTER_FTIME,&ftime,0,0};
unsigned short timlen;
char asctim[21];
struct dsc$descriptor timbuf = {20,DSC$K_DTYPE_T,DSC$K_CLASS_S,asctim};
int stat;
stat = sys$getsyiw (0,0,0,&itmlst,0,0,0);
if (!(stat & 1)) return stat;
stat = sys$gettim (&now);
if (!(stat & 1)) return stat;
ftime -= now;
stat = sys$asctim (&timlen , &timbuf , &ftime , 0);
if (!(stat & 1)) return stat;
asctim[timlen] = 0;
printf ("Cluster uptime is %s\n" , asctim);
return 1;
}

(Also atached as file)

Bojan
Ian Miller.
Honored Contributor

Re: System uptime

minor point - iosb should always be included and checked in system calls when they can be. In the case of this getsyiw it probably does not matter as its just reading a system data cell but you never know.

Now I expect examples in perl, python, and other favorite programming languages :-)
____________________
Purely Personal Opinion