TOP problem
Hi guys,
I am new to Linux and I have the following problem: I have the "top" command and I want to override its default behavior for every user, even for future users. Writing with "W" in top is not an option as my top command somehow overrides the custom behavior per user and always turns to default behavior. So, what I am asking for is, are there command line switches that override default behavior of top, for example: Code:
top -<BLABLA> Remember, writing to toprc is not an option for me as top for some reason ignores its config and just goes for default behavior. Edit: it seems to me this is a bug in the procps package. That is why I updated it to the latest version for my distro CentOS 5.5 and procps to the following http://rpm.pbone.net/index.php3/stat...86_64.rpm.html HOWEVER, it doesn't work even now. I can't believe that nobody in this forum haven't seen the problem. |
This is potentially a bug in the version of top that you are running.
If it is not reading .toprc from the user's home directory then it could be related to the fix posted upstream at http://procps.cvs.sourceforge.net/vi...1.132&r2=1.134 It is worth filing a bug against centos 5.5 |
Quote:
procps-3.2.7-16.el5 but it is the same story. The thing is it works perfectly when called locally by the script, but this same script, when called by the same user using nrpe, doesn't behave correctly. I am not really sure who is to blame. To summarize: Top behaves differently when called with the same user respectively from nrpe and from a locally residing script. I assume it SHOULD have the same config (/home/nagios/.toprc) but when called from nrpe, it ignores its home directory and switches to default. Any hints? |
Quote:
Quote:
|
Quote:
I hate derogatory remarks. Did you at least read what I wrote above? If you did you might wanna check YOUR top man and tell me why it behaves differently WHEN CALLED FROM THE SAME USER, although the /home/<user>/.toprc file exists?! Is there anyone else who actually read my question? |
Does the script change directory at all?
in the script, before you call top, get it to echo $PWD to see where the script is running. |
Quote:
Here is the problem: 1. When called locally with user nagios, the script changes the directory as I wish, because it uses the top command for user nagios, which has its configuration file in /home/nagios/.toprc. 2. However, when called from a deamon (nrpe) with the same user (nagios), the script changes the directory in a different way, because top IGNORES its configuration file and switches to default. P.S I am absolutely sure that the script is called with the same user on both occasions because I straced it, lsof-ed it and what else. My question is the following: is there anything else besides user name that tells top where to find its config file. In the documentation it says there isn't. If that is so, top sometimes ignores its configuration file and that is a bug. P.P.S. This was indeed a bug in procps library but in 2006. As far as I see in the bug fixes, this bug was addressed. However, I am with the newest release and it still bugs. Any hints? P.P.P.S I am now actually even surer, as I made a "whoami" and in both cases the user is nagios. HINTS!? |
All I know is I have the same bug in gentoo, with the newest version of top and its something to do with the way it writes out the config file.
However this doesn't explain the behaviour your seeing (as if its accessing two different versions of top |
Quote:
|
All times are GMT -5. The time now is 12:50 AM. |