Common installation errors

Errors when you open the pmGraph page

If you get this message while you are trying to access the website:

Unable to get a connection to Mysql server due to java security restriction.
Disable java security or add necessary permissions (check the log file for more info)

You may be having problems with the security option set by default in Ubuntu. To disable it, you have to go to the file Tomcat5.5 in /etc/default and write TOMCAT5_SECURITY=no. After that, restart the server.

sudo /etc/init.d/Tomcat5.5 restart

If you prefer not to disable it, you may need to add the necessary permissions in the policy file.

Problems with the policy file

We recommend that you disable the security option in Tomcat, as stated in the installation instructions. If you have decided to enable the security option in Tomcat, there are several errors that can be encountered if you have not added specific permissions in the Tomcat WebApps policy file. These are some error messages associated with this problem:

Unable to get a connection to Mysql server due to java security restriction. 
Disable java security or add necessary permissions (check the log file for more info).
A Security Exception has occurred while trying to create graph image. 
This error is caused by Java security policy, disable java security or add a suitable permission in policy file.
A Security Exception has occurred while trying to access sun.awt.* clasess. 
This error is caused by Java security policy, disable java security or add a suitable permission in policy file.
Unable to access DNS server, check java security policy file.

To grant the permissions needed, edit the file 04webapps.policy which, in Ubuntu 8.04, can be found at /etc/tomcat5.5/policy.d and modify the file. Assuming you are using the default SQL server, add the following lines:

permission java.net.SocketPermission "localhost:3306-", "accept,connect,listen";
permission java.io.FilePermission "var/lib/tomcat5.5/pmgraph/WEB_INF/classes/logging.properties",  "read";
permission java.awt.RuntimePermission "sun.awt.*";
permission java.util.PropertyPermission "dns.server", "read";
permission java.util.PropertyPermission "dns.search", "read";
permission java.io.FilePermission "/etc/resolv.conf", "read";
permission java.net.SocketPermission "DHCPServer adress:53", "connect,resolve";

Problems with the pmGraph configuration file

The pmGraph configuration file has to be customized to match the user and password you have in mysql for pmacct, as well as with the database you created. This file can be found under the Tomcat directory /usr/share/Tomcat5.5 at the following location: webapps/pmGraph/WEB_INF/classes. The name of the file is database.properties. The program will show you the same error when any of the parameters in the configuration file (user, password, database name...) are wrong:

Unable to get a mysql connection, please check your database.properties file

ErrorMessage4 Screenshot

To solve all these problems you have to open and edit this file, using an editor like nano or vim, and make the changes that are needed. Remember that you need superuser rights to be able to change the file.

To see a full explanation of the configuration file, click here.

If you can open the pmGraph page but graph is empty

GraphEmpty2 Screenshot

you may have one of the following problems:

Problems relating to the database

Check if data is being stored. Go to mysql and try to connect with the user you created:

mysql -u ''user'' -p

If you can't do this, you may not have added the correct password in the pmacct configuration file to access to the database. Check it in the file pmacctd.conf (in /etc/pmacct on Ubuntu) and modify if necessary.

The same will happen if you have set the wrong user in the pmacct configuration file. More info about pmacct configuration parameters can be found here.

Wrong subnet

Another reason why your graph can appear empty is that the local subnet, configured in pmacctd.conf and in database.properties, doesn't match your actual local subnet. To solve it, just open both of them with an editor like vim or nano and modify them to match. Remember that you need superuser rights to modify these files.

If you can open the pmGraph page but there is no graph

You may need to edit the Tomcat startup script {tomcatroot}/bin/catalina.sh (or /usr/share/Tomcat5.5/bin/catalina.sh on Ubuntu 8.04) and add this JAVA_OPTS line just above the #OS specific support line. This enables the chart library to work properly when Tomcat is started with out a display (automatically by the system at boot time, or on a remote shell).

JAVA_OPTS="_Djava.awt.headless=true"
#OS specific support. $var _must_ be set to either true or false

If none of these problems match yours, you can try several things

Check java version

type

java -version

at the command line. We recommend using Sun java "sun-java6-jdk". GNU java can cause errors.

Check the configuration file for Tomcat

usually located at "/etc/default/", modify it to disable the java_security option

TOMCAT5_SECURITY=no

If you don't do this you will have to add some permissions to the policy file, as above.

PGP key problem (NO_PUBKEY)

If after updating the list of available packages, you get this message:

http://ppa.launchpad.net hardy Release: The following signatures couldn't be verified because the public key is
not available: NO_PUBKEY XXXXXXXXXXXXX

W: You may want to run apt-get update to correct these problems

There is a problem with the key that was provided in the instructions. To check whether the key matches the one in the instructions, read the key at the end of the message (after NO_PUBKEY), if it doesn't match the default key you have to import it.

To import this key you have to copy the number that appears after the text NO_PUBKEY and use it in the following command.

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com XXXXXXXXXXXXX

Update the list of available packages:

sudo apt-get update

Trying on your own

If you haven't found your error in the list above and want to investigate further, modify the log file:

Enable "debug" level log in the file of log4j.properties located at $TOMCAT_HOME/webapps/pmgraph/WEB-INF/classes/

change this line:

log4j.rootCategory=info, stdout

to

log4j.rootCategory=debug, stdout

Now in the log directory for Tomcat in a file called catalina you should receive verbose output of what pmGraph is doing. If this file doesn't exist then try the /var/log/syslog file.

Contact us

If you can't find the solution for your problem, please send us an email telling your specific problem. Please try to be as clear as possible and send us some screenshots with the error you encountered.

Back to the main page