whatthe! has asked for the wisdom of the Perl Monks concerning the following question:

I recently heard about psmon from an article on linux.com. Having been searching for a system monitor with similar features I decided to give psmon a try. My problem is that the installation instructions weren't exactly detailed enough for a complete n00b. I have psmon currently installed, and it is working, but there were some errors with the installation. So I was hoping someone could walk me through the process of installing psmon on a kubuntu machine and hopefully point out my mistakes.

I'm currently running Kubuntu 8.04 with KDE 4.1. To begin with I configured CPAN, no errors there. Then I installed the following modules using "perl -MCPAN -e 'install moduleName'"

Config::General
Proc::ProcessTable
Net::SMTP
Unix::Syslog
Getopt::Long

And then I probably did something completely unnecessary, but then again I had no idea whether psmon was already installed at this point. So I ran the install.sh script that's included in the psmon download from psmon.com. Does one of the modules above include psmon? If I install all of them do I need to bother with the install.sh script?

After installing everything I setup the psmon.conf file in the /etc folder. I then ran psmon --daemon which gave me an error stating that the psmon.conf file couldn't be found in the /home/username/etc folder. Why would it be looking in my home folder for the conf file? And how can I change it to look for it at /etc/psmon.conf?

After creating an etc folder in my home directory and copying the conf file I was able to run the background daemon successfully. However I was also presented with another questionable message from the terminal.

psmon6646: Forking background daemon, process 6647.
psmon6647: Forking second background daemon, process 6648.

Is it normal for it to fork 2 background daemons? And if not, how can I fix this? Thanks for your patience with this complete perl n00b.

Replies are listed 'Best First'.
Re: how to install psmon for dummies
by zentara (Cardinal) on Sep 04, 2008 at 15:34 UTC
    I would try doing the psmon install the normal way, and see if you get any errors. Dowmload and untar psmon-1.29.tar.gz. Then go into the psmon dir and do
    perl Makefile.pl make # then sudo to root and let root do make install
    Your problem probably is you tried to install psmon as a user, instead of system-wide, and it put everything in your home directory's Perl5Lib.

    Do what is showed above and report any errors you get. Also do a "which -a psmon" to see if you have extra copies somewhere in your path. Delete the one found in your home directory, if there is one.


    I'm not really a human, but I play one on earth Remember How Lucky You Are
      After reinstalling psmon I typed 'which -a psmon' which only lists the following path.

      /usr/bin/psmon

      After running psmon as root I was able to get it to search for the conf file in /etc. Apparently when it's run as a normal user it looks in $HOME/etc/psmon.conf. So my only problem left is the 2 background daemons. I suppose this could be normal behavior. When you run "sudo psmon --daemon" does it give you the same message? Thanks for your help.

      Just did a search for all psmon files on my system and this is what I found.

      /tmp/psmon-1000-3446.pid
      /var/run/psmon-0-2188.pid
      /var/tmp/psmon.conf.swp
      /usr/bin/psmon-config
      /usr/bin/psmon
      /usr/share/man/man1/psmon.1
      /etc/psmon.conf
        I don't run psmon, so I can't say what is the expected behavior. I don't see from your file list, anything showing 2 background daemons. That would show up in "ps aux | grep psmon". But if you get 2 it may be normal, it may fork as a daemon.

        I'm not really a human, but I play one on earth Remember How Lucky You Are
Re: how to install psmon for dummies
by Anonymous Monk on Sep 04, 2008 at 14:33 UTC