<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting and graphing user login totals in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518549#M872010</link>
    <description>Just add some lines to Patrick's script...&lt;BR /&gt;and make an HTML table...&lt;BR /&gt;Graphing it would be a little bit more complicated...&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh &lt;BR /&gt;num_user=`/usr/bin/who -q | grep users | awk -F= '{ print $2 }'` &lt;BR /&gt;date1=`date '+%x %X'` &lt;BR /&gt;echo "$num_user,$date1" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;&lt;BR /&gt;## HTML Table builder&lt;BR /&gt;echo "&lt;TITLE&gt; User logging totals &lt;/TITLE&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "$num_user" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TD&gt;&lt;TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "$date1" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TR&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TBODY&gt;&lt;/TABLE&gt;" &amp;gt;&amp;gt;/tmp/pww/numuser.html&lt;BR /&gt;&lt;BR /&gt;cp /tmp/pww/numuser.html &lt;BR /&gt;$WEB_SERVER/html&lt;BR /&gt;&lt;BR /&gt;This way you would always have a "real time" table to Examine in numuser.html&lt;BR /&gt;&lt;BR /&gt;Of course you can add fancy stuff to it...&lt;BR /&gt;&lt;BR /&gt;Ed</description>
    <pubDate>Fri, 20 Apr 2001 09:02:32 GMT</pubDate>
    <dc:creator>Eduardo Uribe_1</dc:creator>
    <dc:date>2001-04-20T09:02:32Z</dc:date>
    <item>
      <title>Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518542#M872003</link>
      <description>I want to graph the user login load of my server(s).  I can use who -q and then grep for "users=" and it gives me the whole line.&lt;BR /&gt;&lt;BR /&gt;What I really need is just the number value that comes after # users=&lt;BR /&gt;&lt;BR /&gt;Anybody know how I can accomplish this and then set cron to get the value every 5 minutes?&lt;BR /&gt;&lt;BR /&gt;I'll worry about how to graph it on a web page later, unless you all have some suggestions about this as well.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.</description>
      <pubDate>Wed, 18 Apr 2001 18:57:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518542#M872003</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2001-04-18T18:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518543#M872004</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;How about this:&lt;BR /&gt;&lt;BR /&gt;Create a script called get_num_users&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;/usr/bin/who -q | grep users | awk -F= '{ print $2 }' &amp;gt;&amp;gt; /dir/num_users&lt;BR /&gt;&lt;BR /&gt;Then put the following entry in cron for root ('crontab -e'):&lt;BR /&gt;&lt;BR /&gt;0,5,10,15,20,25,30,35,40,45,50,55 * * * * /dirname/get_num_users&lt;BR /&gt;&lt;BR /&gt;This should run the get_num_users script every 5 minutes, 24 hours a day, 7 days a week, and append the output to a file called get_num_users.</description>
      <pubDate>Wed, 18 Apr 2001 19:04:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518543#M872004</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-04-18T19:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518544#M872005</link>
      <description>Hi John:&lt;BR /&gt;&lt;BR /&gt;# 0,5,10,15,20,25,30,35,40,45,50,55 * * * * who|wc -l &amp;gt;&amp;gt; /tmp/usercount&lt;BR /&gt;&lt;BR /&gt;A crontab entry like this will write the usercount into the file /tmp/usercount every 5-minutes.&lt;BR /&gt;&lt;BR /&gt;See man 'crontab' for more information.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 18 Apr 2001 19:06:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518544#M872005</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-04-18T19:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518545#M872006</link>
      <description>Patrick,&lt;BR /&gt;Excellent!  I knew it had to be AWK or SED, but I'm a complete moron with scripting stuff.&lt;BR /&gt;&lt;BR /&gt;Another wrinkle I forgot.  Do you think it is possible to add the date and time in the file as well?&lt;BR /&gt;&lt;BR /&gt;I'd like to have it read like this:&lt;BR /&gt;25,date (with time)&lt;BR /&gt;&lt;BR /&gt;rather than have it append the date after (below) the user value using &amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;That way I could import it into Excel or something and graph it that way.&lt;BR /&gt;&lt;BR /&gt;Thanks again!</description>
      <pubDate>Wed, 18 Apr 2001 19:31:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518545#M872006</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2001-04-18T19:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518546#M872007</link>
      <description>Hi John:&lt;BR /&gt;&lt;BR /&gt;# 0,5,10,15,20,25,30,35,40,45,50,55 * * * *  &lt;BR /&gt;(date;echo "users =";who|wc -l)|xargs &amp;gt;&amp;gt; /tmp/usercount&lt;BR /&gt;&lt;BR /&gt;will put a one-line value into the file every 5-minutes without the need for 'awk'.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 18 Apr 2001 19:46:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518546#M872007</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-04-18T19:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518547#M872008</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;Here's a new script for you:&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh &lt;BR /&gt;num_user=`/usr/bin/who -q | grep users | awk -F= '{ print $2 }'`&lt;BR /&gt;date1=`date '+%x %X'`&lt;BR /&gt;echo "$num_user,$date1" &amp;gt;&amp;gt; /tmp/pww/numuser&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2001 19:49:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518547#M872008</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-04-18T19:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518548#M872009</link>
      <description>Just add some lines to Patrick's script...&lt;BR /&gt;and make an HTML table...&lt;BR /&gt;Graphing it would be a little bit more complicated...&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh &lt;BR /&gt;num_user=`/usr/bin/who -q | grep users | awk -F= '{ print $2 }'` &lt;BR /&gt;date1=`date '+%x %X'` &lt;BR /&gt;echo "$num_user,$date1" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;&lt;BR /&gt;## HTML Table builder&lt;BR /&gt;echo "&lt;TITLE&gt; User logging totals &lt;/TITLE&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "$num_user" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TD&gt;&lt;TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "$date1" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TR&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TBODY&gt;&lt;/TABLE&gt;" &amp;gt;&amp;gt;$WEB_SERVER/html/numuser.htm&lt;BR /&gt;&lt;BR /&gt;cp /tmp/pww/numuser.html &lt;BR /&gt;$WEB_SERVER/html&lt;BR /&gt;&lt;BR /&gt;This way you would always have a "real time" table to Examine in numuser.html&lt;BR /&gt;&lt;BR /&gt;Of course you can add fancy stuff to it...&lt;BR /&gt;&lt;BR /&gt;Ed</description>
      <pubDate>Fri, 20 Apr 2001 09:01:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518548#M872009</guid>
      <dc:creator>Eduardo Uribe_1</dc:creator>
      <dc:date>2001-04-20T09:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518549#M872010</link>
      <description>Just add some lines to Patrick's script...&lt;BR /&gt;and make an HTML table...&lt;BR /&gt;Graphing it would be a little bit more complicated...&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh &lt;BR /&gt;num_user=`/usr/bin/who -q | grep users | awk -F= '{ print $2 }'` &lt;BR /&gt;date1=`date '+%x %X'` &lt;BR /&gt;echo "$num_user,$date1" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;&lt;BR /&gt;## HTML Table builder&lt;BR /&gt;echo "&lt;TITLE&gt; User logging totals &lt;/TITLE&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "$num_user" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TD&gt;&lt;TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "$date1" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TD&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TR&gt;" &amp;gt;&amp;gt; /tmp/pww/numuser.html&lt;BR /&gt;echo "&lt;/TBODY&gt;&lt;/TABLE&gt;" &amp;gt;&amp;gt;/tmp/pww/numuser.html&lt;BR /&gt;&lt;BR /&gt;cp /tmp/pww/numuser.html &lt;BR /&gt;$WEB_SERVER/html&lt;BR /&gt;&lt;BR /&gt;This way you would always have a "real time" table to Examine in numuser.html&lt;BR /&gt;&lt;BR /&gt;Of course you can add fancy stuff to it...&lt;BR /&gt;&lt;BR /&gt;Ed</description>
      <pubDate>Fri, 20 Apr 2001 09:02:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518549#M872010</guid>
      <dc:creator>Eduardo Uribe_1</dc:creator>
      <dc:date>2001-04-20T09:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting and graphing user login totals</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518550#M872011</link>
      <description>I just wanted to say that I agree with James. Why use the long, less efficient "awk" version of the script when "who|wc -l)|xargs &amp;gt;&amp;gt; /tmp/usercount" would get the same information. &lt;BR /&gt;&lt;BR /&gt;You could still use the other script tips that were offered and you would have a more efficient script.&lt;BR /&gt;&lt;BR /&gt;Hey, it's Friday... don't work so hard ;)&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;David</description>
      <pubDate>Fri, 20 Apr 2001 13:05:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-and-graphing-user-login-totals/m-p/2518550#M872011</guid>
      <dc:creator>David Child_1</dc:creator>
      <dc:date>2001-04-20T13:05:55Z</dc:date>
    </item>
  </channel>
</rss>

