- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Locating source of console messages
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
05-14-2007 03:56 PM
05-14-2007 03:56 PM
Locating source of console messages
Periodically I am getting strange messages on my system console (like "rm: f non-existent"). What is the best method to track down the source of this error? Thanks!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2007 04:02 PM
05-14-2007 04:02 PM
Re: Locating source of console messages
It could be anything directed to the console, but most of the time its syslog. Check your latest syslog to see if it has the same error or message.
From the error it seems there is a script calling the 'rm' command with 'f' as a parameter option. It probably meant to be 'rm -f' or the likes.
Its likely to be a cron job. Grep for the message under /var/spool/cron (hope i did get this missed up with Solaris).
Jov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 11:04 AM
05-15-2007 11:04 AM
Re: Locating source of console messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 11:17 AM
05-15-2007 11:17 AM
Re: Locating source of console messages
If you have lsof installed then "lsof /dev/console" might prove useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 11:31 AM
05-15-2007 11:31 AM
Re: Locating source of console messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 11:34 AM
05-15-2007 11:34 AM
Re: Locating source of console messages
Log/redirect the output to a file until the message comes up again. That should give you the program calling rm (hope you dont have a large number of scripts/apps calling 'rm').
Jov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 12:07 PM
05-15-2007 12:07 PM
Re: Locating source of console messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 01:00 PM
05-15-2007 01:00 PM
Re: Locating source of console messages
Get lsof from here and install it. It's a utility no HP-UX box should be without.
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.77/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2007 01:16 PM
05-15-2007 01:16 PM
Re: Locating source of console messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2007 02:21 PM
05-16-2007 02:21 PM
Re: Locating source of console messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2007 04:07 PM
05-16-2007 04:07 PM
Re: Locating source of console messages
lsof -r 30 /dev/console >> /var/tmp/lsof.log
This will run the command at 30 second interval; sooner or later you should hit paydirt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2007 03:00 PM
05-17-2007 03:00 PM
Re: Locating source of console messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2007 03:07 PM
05-17-2007 03:07 PM
Re: Locating source of console messages
You could aosi get lucking by simply doing
date commands followed by ps -ef's and sleep 25 in a loop logging to a file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2007 03:15 PM
05-17-2007 03:15 PM
Re: Locating source of console messages
You can create a perl or shell wrapper for 'rm' which spits out the caller procces id/name with something like 'ps' and grep for rm into a log file. This *should* work assumming the caller program/script is waiting for a return/exit code from 'rm'.
I've never tried it, just a theory at the moment.
Jov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2007 05:45 PM
05-18-2007 05:45 PM
Re: Locating source of console messages
This seems like a more refined way to find the evil user doing that rm, than using lsof.
Also, does the author know what file occurs in the message? If so, that would make the script even more targeted.
>assumming the caller program/script is waiting for a return/exit code from 'rm'.
By that, only log it if there is a bad exit from the real rm?