- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sample cron to capture Dmesg
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
Discussions
Discussions
Discussions
Forums
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
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
тАО01-19-2005 02:05 AM
тАО01-19-2005 02:05 AM
for capturing output from "dmesg".
thanks in advance.
Tom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 02:14 AM
тАО01-19-2005 02:14 AM
Re: sample cron to capture Dmesg
could you please clarify?
dmesg is a cyclic buffer, so do you want to have the output of dmesg redirected into a log file (dmesg >> /tmp/log.log) ?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 02:14 AM
тАО01-19-2005 02:14 AM
Re: sample cron to capture Dmesg
DESCRIPTION
dmesg looks in a system buffer for recently printed diagnostic messages and prints them on the standard output. The messages are those printed by the system when unusual events occur (such as when system tables overflow or the system crashes). If the - argument is specified, dmesg computes incrementally) the new messages since the last time it was run and places these on the standard output. This is typically used with cron (see cron(1)) to produce the error log /var/adm/messages by running the command:
/usr/sbin/dmesg - >> /var/adm/messages
every 10 minutes.
so something like
10 * * * * /usr/sbin/dmesg - >> /var/adm/messages
Or whatever log file you want to use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 02:27 AM
тАО01-19-2005 02:27 AM
Re: sample cron to capture Dmesg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 02:30 AM
тАО01-19-2005 02:30 AM
Re: sample cron to capture Dmesg
ypu don't have to capture its output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 03:35 AM
тАО01-19-2005 03:35 AM
Re: sample cron to capture Dmesg
"there is no entry in cron to capture the output of dmesg at a regular interval."
so, maybe what I have to do to resolve this item from the audit is:
run "dmesg" only once a week or once a day.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 03:46 AM
тАО01-19-2005 03:46 AM
Solution1) One per day to print the actual dmesg buffer contents (no "-")
2) One every 10 minutes or so to print the delta's
1 0 * * * /usr/sbin/dmesg >> /var/adm/dmesg.log
2,12,22,32,42,52 * * * * /usr/bin/dmesg - >> /var/adm/dmesg.log
You might want to actually write a script that outputs the "date" output followed by dmesg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 05:34 AM
тАО01-19-2005 05:34 AM
Re: sample cron to capture Dmesg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2005 08:27 AM
тАО01-19-2005 08:27 AM
Re: sample cron to capture Dmesg
"there is no entry in cron to capture the output of dmesg at a regular interval."
is not aware that dmesg (for HP-UX) has an easy workaround. The "-" option does two things: it reports only what has been added since the last dmesg - command, and two: it timestamps the new messages, something is missing from other Unix-flavor cron solutions. The man page and the default cron job example in /usr/newconfig/var/spool/cron/crontab.root shows you exactly how to log every dmesg entry into a log file. The 1-liner:
05,15,25,35,45,55 * * * * /usr/sbin/dmesg - >>/var/adm/messages
takes care of the audit requirement. Although a lot of Unix flavors suggest the filename "messages" , I think dmesg.log is a lot more intuitive.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2005 12:37 PM
тАО02-11-2005 12:37 PM