IBM / nagios-for-i

MIT License
19 stars 20 forks source link

No X11 DISPLAY variable was set, but this program performed an operation which requires it. #26

Open richiecoy opened 2 years ago

richiecoy commented 2 years ago

I am using the ibmi plugin to check many iseries. Over the weekend I started getting the below error. We are using a centos 7 server to run the plugin. Other iseries work ok, its just one that is not working, very strange.

Here is my command: ./check_ibmi_status.sh -M ASPUsage -SSL n -H $ARG6$ -W 90 -C 95

I have tried setthing the DISPLAY variable, but that does not fix the issue.

Any ideas?

Unknown (No output returned from plugin) No X11 DISPLAY variable was set, but this program performed an operation which requires it. java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204) java.awt.Window.(Window.java:536) java.awt.Frame.(Frame.java:420) java.awt.Frame.(Frame.java:385) com.ibm.as400.access.ToolboxSignonHandler.displayMessage(ToolboxSignonHandler.java:336) com.ibm.as400.access.ToolboxSignonHandler.passwordAboutToExpire(ToolboxSignonHandler.java:88) com.ibm.as400.access.AS400.promptSignon(AS400.java:2956) com.ibm.as400.access.AS400.signon(AS400.java:4246) com.ibm.as400.access.AS400.connectService(AS400.java:1336) com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:3383) com.ibm.as400.access.AS400JDBCDataSource.getConnection(AS400JDBCDataSource.java:706) com.ibm.as400.access.AS400JDBCDataSource.getConnection(AS400JDBCDataSource.java:564) com.ibm.as400.access.AS400JDBCConnectionPool.createPooledConnection(AS400JDBCConnectionPool.java:307) com.ibm.as400.access.AS400JDBCConnectionPool.fill(AS400JDBCConnectionPool.java:344) com.ibm.as400.access.AS400JDBCConnectionPool.getPooledConnection(AS400JDBCConnectionPool.java:501) com.ibm.as400.access.AS400JDBCConnectionPool.getConnection(AS400JDBCConnectionPool.java:456) com.ibm.nagios.util.JDBCConnection.getJDBCConnection(JDBCConnection.java:35) com.ibm.nagios.service.impl.ASPUsage.execute(ASPUsage.java:39) com.ibm.nagios.client.CheckIBMiStatus.main(CheckIBMiStatus.java:73)

[java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204) at java.awt.Window.(Window.java:536) at java.awt.Frame.(Frame.java:420) at java.awt.Frame.(Frame.java:385) at com.ibm.as400.access.ToolboxSignonHandler.displayMessage(ToolboxSignonHandler.java:336) at com.ibm.as400.access.ToolboxSignonHandler.passwordAboutToExpire(ToolboxSignonHandler.java:88) at com.ibm.as400.access.AS400.promptSignon(AS400.java:2956) at com.ibm.as400.access.AS400.signon(AS400.java:4246) at com.ibm.as400.access.AS400.connectService(AS400.java:1336) at com.ibm.as400.access.AS400JDBCConnection.setProperties(AS400JDBCConnection.java:3383) at com.ibm.as400.access.AS400JDBCDataSource.getConnection(AS400JDBCDataSource.java:706) at com.ibm.as400.access.AS400JDBCDataSource.getConnection(AS400JDBCDataSource.java:564) at com.ibm.as400.access.AS400JDBCConnectionPool.createPooledConnection(AS400JDBCConnectionPool.java:307) at com.ibm.as400.access.AS400JDBCConnectionPool.fill(AS400JDBCConnectionPool.java:344) at com.ibm.as400.access.AS400JDBCConnectionPool.getPooledConnection(AS400JDBCConnectionPool.java:501) at com.ibm.as400.access.AS400JDBCConnectionPool.getConnection(AS400JDBCConnectionPool.java:456) at com.ibm.nagios.util.JDBCConnection.getJDBCConnection(JDBCConnection.java:35) at com.ibm.nagios.service.impl.ASPUsage.execute(ASPUsage.java:39) at com.ibm.nagios.client.CheckIBMiStatus.main(CheckIBMiStatus.java:73)]

BallonLac commented 2 years ago

I had a strange behaviour like yours, once. Solved by creating a fresh new user profile, copying untouched QSECOFR and then, after testing, restricting rights/class.

ThePrez commented 2 years ago

Try setting environment variable JAVA_TOOL_OPTIONS=-Djava.awt.headless=true