Operating System - HP-UX
1753872 Members
7563 Online
108809 Solutions
New Discussion юеВ

Re: 'last' command produces way too much whitespace on output

 
David Corlette
New Member

'last' command produces way too much whitespace on output

I have a customer using HP-UX v1, v2, v3 (several versions) and they are attempting to use the 'last' command to examine the login activity.
On some systems, they see normal 'last' output like this:
root console Mon Feb 18 17:52 - 12:20 (37+18:28)

On other systems, their 'last' output has a huge amount of whitespace, like this:
root console Wed Oct 20 20:42 - 20:53 (00:10)


What the heck is going on? How do we fix 'last' to not do this?
5 REPLIES 5
Hein van den Heuvel
Honored Contributor

Re: 'last' command produces way too much whitespace on output


Would the system showing this be HPUX 11-V3?
Is it only 'last' showing issues, or other tools as well?

This is a WAG (Wild A$$ Guess):
Maybe Long Usernames are enabled?
Check: man lugadmin

Or the whitepaper:
http://h20000.www2.hp.com/bc/docs/support/SupportManual/c01925719/c01925719.pdf?jumpid=reg_R1002_USEN

( used to be http://docs.hp.com/en/5992-4118/longusername_white_paper_updated.pdf )

hth,
Hein
Ismail Azad
Esteemed Contributor

Re: 'last' command produces way too much whitespace on output

Hi david,

I did a little "looking into" your problem and with the hint of the olmpians WAG {which was a spot on}, came with this finding....

I assume the command lugadmin -l shows 256 which means long usernames are enabled. Now, when this command - #lugadmin -e is executed the "user display width" is configured in a file called as /etc/default/lugname which takes the default "user display width".

On execution of lugadmin -e alone this excessive white space problem does not happen as the attribute UG_DISPLAY_WIDTH defaults to 0 in /etc/default/lugname. However, let's say you execute lugadmin -e -d 30. You will see a huge distance between spaces for fields in the "last" command as UG_DISPLAY_WIDTH is now 30 {the user display width}. Hence, if you don't want to see this huge whitespace or if you don't want to see {remember i said 'see' not disable as this is not possible!} the complete "long" usernames you could execute lugadmin -d 0 which will give you the normal "white space disance" seen on the other servers and following any username having 8 characters or more should be succeeded by a + sign.

The answer in a nutshell would be "the user DISPLAY width" that has been configured with your long usernames.

Welcome to ITRC! Don't forget to assign points!!!.

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
Dennis Handly
Acclaimed Contributor

Re: 'last' command produces way too much whitespace on output

>How do we fix 'last' to not do this?

I assume you aren't using -x for long names?
Otherwise Hein is correct about lugadmin(1M).
nijokj
Trusted Contributor

Re: 'last' command produces way too much whitespace on output

To enable long user and group names,

1. Stop the pwgrd daemon.

# /sbin/init.d/pwgr stop

2. Run the lugadmin command with the -e option.


# lugadmin -e [-d num]

3. The command requests confirmation before enabling the
system.

Long user/group name once enabled cannot be disabled in future.
Do you want to continue [yY]:

If you respond with y or Y, the command proceeds; otherwise,
it aborts.

4. The command creates the /etc/default/lugname file.

5. If the -d option is not specified, num defaults to 0. The
specified or default value of num is written in lugname.



eg: lugadmin -e -d 255

try -x flag with your lastb command.
David Corlette
New Member

Re: 'last' command produces way too much whitespace on output

Thanks to all who commented - I will pass this along to the customer and see if they can resolve the problem.

Hopefully they will get back to us so we can credit the right response.