1752795 Members
5947 Online
108789 Solutions
New Discussion юеВ

Re: System uptime

 
SOLVED
Go to solution
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