AIX

 View Only
Expand all | Collapse all

Logging maximum number of concurrent users in AIX

  • 1.  Logging maximum number of concurrent users in AIX

    Posted Thu January 25, 2024 01:45 PM

    Hi,  is there a way to log and or view the history of the maximum number of concurrent authenticated user logins in AIX?

    A Google search did not return anything useful.



    ------------------------------
    Paul Boserup
    ------------------------------


  • 2.  RE: Logging maximum number of concurrent users in AIX

    IBM Champion
    Posted Fri January 26, 2024 03:02 AM

    Hello Paul,

    I think you searching for something like the last command on AIX.

    With this simple command you can query on specific time stamp who was logged in at that time.

    See example below for Year 2024 Jan 25 8:00 hour:

    last -t 202401250800 

    user1   pts/1        10.210.152.221         Jan 25 07:47 - 08:32  (00:45)

    user3   pts/6        10.212.141.56          Jan 22 10:26   still logged in.

    user2   pts/4        10.212.141.56          Jan 22 09:57   still logged in.

    wtmp begins     Jan 15 13:35

    It also shows at the last line since when the wtmp is recording, in other words when it was cleared for the time.

    Just let me know if this is the answer you're looking for.

    Greetings Christian Sonnemans.



    ------------------------------
    Christian Sonnemans
    Tactical Unix system engineer
    De Volksbank
    Den Bosch
    +31 (0) 6 53 27 15 71
    ------------------------------



  • 3.  RE: Logging maximum number of concurrent users in AIX

    Posted Tue January 30, 2024 08:53 AM

    Thanks for the reply. I have dumped the LAST output (3 years worth) into a text file and am exploring ways to format and graph.

     

     

    Paul Boserup
    Senior Server Engineer
    Information Systems - Technical Services
    Sarasota Memorial Hospital
    941-302-7154
    mobile

     

    *************************************************************************
    Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.





  • 4.  RE: Logging maximum number of concurrent users in AIX

    Posted Thu February 01, 2024 12:38 PM

    Hi Paul

    I'm curious to know how do you know/extract the value of year from wtmp entries. When i run last command it doesn't show which year the entries are from only day and month.

    With Regards

    Albert M.



    ------------------------------
    Albert Maira
    ------------------------------



  • 5.  RE: Logging maximum number of concurrent users in AIX

    Posted Thu February 01, 2024 12:52 PM

    The top of the file has the current date, so that would be 2024.

    Scroll down to the Jan to Dec roll over that would be 2023

    and so on.

     

    Paul Boserup
    Senior Server Engineer
    Information Systems - Technical Services
    Sarasota Memorial Hospital
    941-302-7154
    mobile

     

    *************************************************************************
    Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.





  • 6.  RE: Logging maximum number of concurrent users in AIX

    Posted Fri February 02, 2024 03:10 AM

    I think "man fwtmp" might come handy here.



    ------------------------------
    Lech Szychowski
    ------------------------------



  • 7.  RE: Logging maximum number of concurrent users in AIX

    Posted Fri February 02, 2024 04:32 AM

    Hi Lech

    Thank you for your guidance, I was able to get what I need.

    With Regards

    Albert M.

     

    Albert Maira
    Supervisor Server & Storage

    Head Office, Ally Hassan Mwinyi Road
    P.O. Box 268, Dar es Salaam
    Mob: +255763511548
    Ext No: 2074


    Classification: CRDB Public

    From:
    Lech Szychowski via IBM TechXchange Community <Mail@ConnectedCommunity.org>
    Sent: Friday, 2 February 2024 11:12
    To: Albert Maira <Albert.Maira@crdbbank.co.tz>
    Subject: RE: AIX : Logging maximum number of concurrent users in AIX

     

    I think "man fwtmp" might come handy here. ------------------------------ Lech Szychowski ------------------------------ -posted to the "AIX" group






  • 8.  RE: Logging maximum number of concurrent users in AIX

    IBM Champion
    Posted Fri February 02, 2024 03:58 AM

    The "last" command won't show you the year, which leaves you with three options:
    - Write your own "last" command (the utmp entry in utmp.h as a time entry:  time64_t ut_time), so it's just a matter of formatting.
    - Count back through the Jan-Dec rollovers.  (I've once ran across an LPAR with 16 rollovers)
    - Rotate wtmp on a yearly/monthly basis (note that this will leave incomplete entries in wtmp)



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------



  • 9.  RE: Logging maximum number of concurrent users in AIX

    Posted Mon January 29, 2024 05:30 AM

    Interesting question.

    • Not clear on why you want too know this number as most AIX servers do not allow users to log in at all.
    • AIX servers are accessed via the services the server provides over the network.
    • I guess system administrators log in directly.
    • Tracking online users would let you "see" if sysadmin people are leaving sessions connected or might highlight hacking activity.

    To see the number of currently logged in the uptime command (or API) is useful.

    Both njmon for AIX and njmon for Linux record the number of users in the uptime measure.

    These would allow instant graphing over time, if you have the data in InfluxDB and use Grafana - or alternative tools.

    If you are already using njmon/nimon and a database then you can go look at the data today and the stat in history.

    If you want to implement the following then you will only see the stats from the moment you implement i.e. no history.


    nmon for Linux does not save the users count - I will add uptime user count in the next upgrade.

    If someone wants to try and test this urgently, let me know and "hack" the code ASAP.

    Down stream graphing tools (like nmonchart), would need minor changes to graph the user stats

    nmon for AIX does not have users counter and is harder to upgrade - sorry but I don't have access to AIX at the moment.
    You would have to request this additional feature using the RFE to IBM and it might arrive in next years AIX releases.

    nmon does allow users to add extra stats via the the nmon external data collector function.
    Would take an hour or two to implement (for a competent AIX systems administrator) and then start rolling out the new feature.

    See https://www.ibm.com/support/pages/nmon-and-external-data-collectors

    All the above would allow collecting stats

    Hope this helps, @mr_nmon



    ------------------------------
    nigel griffiths
    ------------------------------



  • 10.  RE: Logging maximum number of concurrent users in AIX

    Posted Tue January 30, 2024 08:56 AM

    Thanks for the reply. This is a 20+ year old cache' system where every user logs on to AIX.

    Just trying to get a sense for how many concurrent users are hitting the server.

     

    Paul Boserup
    Senior Server Engineer
    Information Systems - Technical Services
    Sarasota Memorial Hospital
    941-302-7154
    mobile

     

    *************************************************************************
    Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.





  • 11.  RE: Logging maximum number of concurrent users in AIX

    IBM Champion
    Posted Tue January 30, 2024 10:09 AM

    AIX doesn't keep that metric.  If you need it, you must collect the output of "who|wc -l" at set intervals.

    On the other hand, you might be facing an X/Y problem, what is the intended use of this metric ?



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------



  • 12.  RE: Logging maximum number of concurrent users in AIX

    Posted Tue January 30, 2024 10:22 AM

    Thanks for your reply. This appears to be nice and simple solution to what I need.

    Mgmt is wanting to know the max number of concurrent users hitting the box and how it relates to utilization.

    They are looking to add more users to the system and want to know how many more can be accommodated.

     

     

    Paul Boserup
    Senior Server Engineer
    Information Systems - Technical Services
    Sarasota Memorial Hospital
    941-302-7154
    mobile

     

    *************************************************************************
    Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.





  • 13.  RE: Logging maximum number of concurrent users in AIX

    IBM Champion
    Posted Tue January 30, 2024 10:52 AM

    Note that here "concurrent" is "logged in at the same time", not "working at the same time", so management's usual linear approach may backfire spectacularly if the amount of work per user times time unit is significantly higher for the new users than for the previous ones.



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------



  • 14.  RE: Logging maximum number of concurrent users in AIX

    Posted Tue January 30, 2024 12:05 PM

    Good point, duly noted. Here is what I've come up with and plan to add this as a cron job.

    echo "$(date +%Y%m%d%k%M) $((who)|wc -l)" >> /var/log/MaxUsers/MaxUsers.log

     

    Paul Boserup
    Senior Server Engineer
    Information Systems - Technical Services
    Sarasota Memorial Hospital
    941-302-7154
    mobile

     

    *************************************************************************
    Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.





  • 15.  RE: Logging maximum number of concurrent users in AIX

    Posted Tue January 30, 2024 12:26 PM
    Paul,

    Why not just log the output of "uptime" at a routine interval?

    Thanks.

    On Tue, Jan 30, 2024 at 05:04:50PM +0000, Paul Boserup via IBM TechXchange Community wrote:
    > Good point, duly noted. Here is what I've come up with and plan to add this as a cron job.
    >
    > echo "$(date +%Y%m%d%k%M) $((who)|wc -l)" >> /var/log/MaxUsers/MaxUsers.log
    >
    >
    >
    > Paul Boserup
    > Senior Server Engineer
    > Information Systems - Technical Services
    > Sarasota Memorial Hospital
    > 941-302-7154 mobile
    >
    >
    > *************************************************************************
    > Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.
    >
    > -------------------------------------------
    > Original Message:
    > Sent: 1/30/2024 10:52:00 AM
    > From: Jos? Pina Coelho
    > Subject: RE: Logging maximum number of concurrent users in AIX
    >
    >
    > Note that here "concurrent" is "logged in at the same time", not "working at the same time", so management's usual linear approach may backfire spectacularly if the amount of work per user times time unit is significantly higher for the new users than for the previous ones.
    >
    >
    >
    >
    > ------------------------------
    > Jos? Pina Coelho
    > IT Specialist at Kyndryl
    > ------------------------------
    > -------------------------------------------
    > Original Message:
    > Sent: Tue January 30, 2024 10:21 AM
    > From: Paul Boserup
    > Subject: Logging maximum number of concurrent users in AIX
    >
    >
    > Thanks for your reply. This appears to be nice and simple solution to what I need.
    >
    > Mgmt is wanting to know the max number of concurrent users hitting the box and how it relates to utilization.
    >
    > They are looking to add more users to the system and want to know how many more can be accommodated.
    >
    >
    >
    >
    >
    > Paul Boserup
    > Senior Server Engineer
    > Information Systems - Technical Services
    > Sarasota Memorial Hospital
    > 941-302-7154 mobile
    >
    >
    > *************************************************************************
    > Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.
    >
    >
    > Original Message:
    > Sent: 1/30/2024 10:09:00 AM
    > From: Jos? Pina Coelho
    > Subject: RE: Logging maximum number of concurrent users in AIX
    >
    >
    > AIX doesn't keep that metric. If you need it, you must collect the output of "who|wc -l" at set intervals.
    >
    > On the other hand, you might be facing an X/Y problem, what is the intended use of this metric ?
    >
    >
    > ------------------------------
    > Jos? Pina Coelho
    > IT Specialist at Kyndryl
    > ------------------------------
    >
    > Original Message:
    > Sent: Thu January 25, 2024 12:11 PM
    > From: Paul Boserup
    > Subject: Logging maximum number of concurrent users in AIX
    >
    >
    > Hi, is there a way to log and or view the history of the maximum number of concurrent authenticated user logins in AIX?
    >
    > A Google search did not return anything useful.
    >
    >
    > ------------------------------
    > Paul Boserup
    > ------------------------------
    >
    >
    > Reply to Sender : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6049&MID=396048&SenderKey=6c2ce62b-8140-41c3-8c58-018d50ef0794
    >
    > Reply to Discussion : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6049&MID=396048
    >
    >
    >
    > You are subscribed to "AIX" as Russell.Adams@AdamsSystems.nl. To change your subscriptions, go to http://community.ibm.com/community/user/preferences?section=Subscriptions. To unsubscribe from this community discussion, go to http://community.ibm.com/HigherLogic/eGroups/Unsubscribe.aspx?UserKey=c23dfccc-9910-40ae-beeb-fdcbced5bf1f&sKey=KeyRemoved&GroupKey=7b554d78-d4dc-417a-b4dc-017e309e5c91.


    ------------------------------------------------------------------
    Russell Adams Russell.Adams@AdamsSystems.nl
    Principal Consultant Adams Systems Consultancy
    https://adamssystems.nl/




  • 16.  RE: Logging maximum number of concurrent users in AIX

    Posted Tue January 30, 2024 01:52 PM

    The output from the command I posted makes for easy analysis/graphing:

    202401301203       39

    202401301203       39

    202401301203       39

    202401301203       39

     

     

    Paul Boserup
    Senior Server Engineer
    Information Systems - Technical Services
    Sarasota Memorial Hospital
    941-302-7154
    mobile

     

    *************************************************************************
    Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.





  • 17.  RE: Logging maximum number of concurrent users in AIX

    IBM Champion
    Posted Wed January 31, 2024 06:35 AM

    Are you positive that you want %k instead of %H ?



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------



  • 18.  RE: Logging maximum number of concurrent users in AIX

    Posted Wed January 31, 2024 09:28 AM

    I had a look at the log and the format of the output looked fine up until 23:59.

     

    202401302357        0

    202401302358        0

    202401302359        0

    20240131 000        0

    20240131 001        0

    20240131 002        0

    20240131 003        0

     

    I've changed the %k to %H.

     

    Thanks for pointing that out!

     

     

    Paul Boserup
    Senior Server Engineer
    Information Systems - Technical Services
    Sarasota Memorial Hospital
    941-302-7154
    mobile

     

    *************************************************************************
    Confidentiality Notice: the information contained in this email and any attachments may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachments for any purpose, nor disclose all or any part of the contents to any other person.





  • 19.  RE: Logging maximum number of concurrent users in AIX

    IBM Champion
    Posted Wed January 31, 2024 09:40 AM

    I had to look up the meaning of %k... :-)



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------