Operating System - HP-UX
1745814 Members
3961 Online
108722 Solutions
New Discussion юеВ

Locating source of console messages

 
TheJuiceman
Super Advisor

Locating source of console messages

Hey gang,

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!!!!
14 REPLIES 14
Jov
Honored Contributor

Re: Locating source of console messages

Hi,

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
TheJuiceman
Super Advisor

Re: Locating source of console messages

Grepping for this string has not given any results. Any other advice? There has to be a way of determining where this is coming from. I tried editing the /etc/syslog.conf file to send alert messages to a file instead of the console, but I'm still getting the messages on the console and nothing in the file.
A. Clay Stephenson
Acclaimed Contributor

Re: Locating source of console messages

This looks more like an application that has redirected stderr to /dev/console that a standard utility that is using syslogd. Are the messages appearing with some periodicity? If so, it suggests a cron'ed job or a script with a fixed sleep interval.

If you have lsof installed then "lsof /dev/console" might prove useful.
If it ain't broke, I can fix that.
TheJuiceman
Super Advisor

Re: Locating source of console messages

I am thinking it is a script too. I do not have lsof unfortunately. Any other suggestions? Thank you again!!!
Jov
Honored Contributor

Re: Locating source of console messages

Clay has given me an idea. Instead of lsof on the console, do an lsof on rm (assuming there is only one and its the 1st in $PATH).

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
TheJuiceman
Super Advisor

Re: Locating source of console messages

Nope...that won't work. We have WAY too many things that call rm (just checking my rm wrapper tells me that). And I do not have lsof unfortunately.
A. Clay Stephenson
Acclaimed Contributor

Re: Locating source of console messages

Without lsof, you are shooting in the dark. Fuser might help but it's a poor substitute.

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/
If it ain't broke, I can fix that.
TheJuiceman
Super Advisor

Re: Locating source of console messages

awesome!!! i will get it installed and then go from there. hopefully i can post on here the results (better yet, close the thread and hand out a bunch of points!!!) Thanks again!!!
TheJuiceman
Super Advisor

Re: Locating source of console messages

I have lsof now. How would be the best way to run it so that it will record the error messages when I get them on the console? Thanks again.