?
Solved

uptime not showing number of days it is up

Posted on 2008-06-09
9
Medium Priority
?
2,665 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 22

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 22

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 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