Solved

uptime not showing number of days it is up

Posted on 2008-06-09
9
2,592 Views
Last Modified: 2010-08-05
Hi all,

uptime on a solaris server doesn't show number of days it is up..issue might be wtmpx/utmpx getting truncated not sure or it might be a bug..does any one had similar issue? please let me knwo.

xyz # uptime
 4:01am  6 users,  load average: 12.23, 4.17, 2.62
#

0
Comment
Question by:lkurugan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 21

Expert Comment

by:robocat
ID: 21746365

Uptime seems to need the latest boot record from wtmpx to determine how long the system has been up.

You say the wtmpx gets truncated but you don't know why ?

0
 

Author Comment

by:lkurugan
ID: 21747727
uptime is looking at utmpx, utmpx is getting truncated I think...
0
 

Author Comment

by:lkurugan
ID: 21747839
some thing is screwing up utmpx, not sure which script it is and couple of my colleagues wrote dtrace to see which one is screwing up the files..but couldn't figure out ..I need to find out what process is screwing up utmpx and wtmox..any ideas?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:robocat
ID: 21749052

The most obvious place is to check all crontabs. Look in /var/spool/cron/crontabs to see all scheduled crons for all users.

Also check /etc/logadm.conf to see if anything happens to utmpw/wtmpx there. Also check if you're using runacct.

What's the oldest record in the utmpx database right now ?

(btw: you're right, I trussed uptime and it uses utmpx not wtmpx)

0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 21749220
Some people (admins) try to keep utmpx small by truncation it.
Unfortunately, as it is a binary file and not a text file, it cannot
be truncated using simple commands like "tail" etc.

If you do run
  last
or
  last | grep boot
what do you get as the most recent entries?
0
 

Author Comment

by:lkurugan
ID: 21750728
we are not running runacct, is there a way on solaris 9 to see which processes is touching, modifying utmpx,wtmpx files?

I verified cron entries and they seem to be fine.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 21752055
Do you have any entries at all (use "last")?

If not, copy it away and "rewind" it using
 > /var/adm/wtmpx

To find out what is modifying it:
a) when was it modified last (ls -l /var/adm/wtmpx) ?
b) Run "last" against that date. If there is an entry with that
    date it's likely that this event changed it and not your script
c) Check all (!) crontabs
      grep -v '^#' /var/spool/cron/crontabs/*
d) Also, see if you have any at jobs scheduled:
      at -l
0
 

Accepted Solution

by:
lkurugan earned 0 total points
ID: 21778105
we figured out the simultaneous logout of users is corrupting the utmpx file ( trying to update the file at the same time.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 21838727
I doubt that this is really the reason as it is a normal consition
that multiple users do log out at the same time.
To make sure wtmpx does not get corrupted, only one entry
will get inserted at a time. If there are more, others will get
queued.
Solaris 10 is a very well developed and mature OS.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question