[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

uptime not showing number of days it is up

Posted on 2008-06-09
9
Medium Priority
?
2,702 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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

650 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