- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Monitoring logfile growth
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 12:16 AM
03-02-2004 12:16 AM
I created a logfile template with several conditions. But now, i want to monitor the size of my logfile (generate a message when the logfile is bigger than 10Mega for example).
How can I make this ?
1 - is it possible to monitor the size of the logfile in the same template logfile ?
2 - I must create a monitor template (program type) that launch a script which return the size of this file ?
Please, someone can give me an idea...
Thanks
Delphine.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 12:24 AM
03-02-2004 12:24 AM
Solutionif [ "$testlog" -gt 1000 ]
then
echo "The log file is too big."
I have used the number 1000 - you can substitute any number you choose. Save this as an executable shell script and run it as a cron job as often as you need.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 12:27 AM
03-02-2004 12:27 AM
Re: Monitoring logfile growth
Sam has a "routine task" for systemlog files, just fire up sam "Routine Tasks" " Systems Log Files" "action" add a logfile.
HTH,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 12:29 AM
03-02-2004 12:29 AM
Re: Monitoring logfile growth
size=`ll "file_to_monitor"|awk '{print $5}'`
(This will be in bytes)
if [ $size -ge 10000 ]
then
mailx "your stuff" xyz@abc.com
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 12:33 AM
03-02-2004 12:33 AM
Re: Monitoring logfile growth
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=52081
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=66144
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=57218
http://tinyurl.com/2pux9
Regards,
Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 12:53 AM
03-02-2004 12:53 AM
Re: Monitoring logfile growth
perl -e 'map { if(((stat $_)[7])>1048576){print "TOO BIG"}} glob "logfile*"'
It does it for all files that have the name "logfile*" and prints "TOO BIG" if they are over 10MB. You can adjust it easily.
Merijn will have this down to a three byte script any time now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 02:00 AM
03-02-2004 02:00 AM
Re: Monitoring logfile growth
I understant now how to get the size of my logfile in a shell script.
But one more question :
What is cron and SAM ?
NB : I want to create a SPI which integrated a logfile and i want to create a monitor that control the size of this logfile...
thanks u
//(^_^)\\
Delphine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 02:05 AM
03-02-2004 02:05 AM
Re: Monitoring logfile growth
SAM = system administration manager.
Type sam on the command line and sam will load.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2004 02:57 AM
03-02-2004 02:57 AM
Re: Monitoring logfile growth
http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/
Rgds...Geoff