@Override
		public void monitor() {
			
				try {
					AS400 as400 = new AS400(hostname);
					as400.setUserId(username);
					as400.setPassword(password);
					RMessageQueue messageQueue = new RMessageQueue(as400, "/QSYS.LIB/QSYSOPR.MSGQ");
					Integer intSeverity = new Integer(40);
					messageQueue.setSelectionValue(RMessageQueue.SEVERITY_CRITERIA, intSeverity);
					messageQueue.open();
					messageQueue.waitForComplete();
					StringBuffer messageText = new StringBuffer();
					int returnStatus = 0;
					
					long numberOfMessages = messageQueue.getListLength();
					for (long i = 0; i < numberOfMessages; ++i) {
						RQueuedMessage queuedMessage = (RQueuedMessage) messageQueue.resourceAt(i);
						int messageInString = queuedMessage.toString().indexOf(strMsgs);
						int messageInMessageText = messageText.toString().indexOf(queuedMessage.getAttributeValue(RQueuedMessage.MESSAGE_TEXT).toString());
						if (messageInString > -1 && messageInMessageText == -1) {
							if (messageInString > -1) {
								messageText.append(queuedMessage.getAttributeValue(RQueuedMessage.MESSAGE_TEXT));
								returnStatus = 1;
							}
						}
					}

					addVariable("messageCount", numberOfMessages);

					messageQueue.close();
					if (returnStatus == 1) {
						message = "PTFs to install. \r" + messageText;
						setState(MonitorState.WARN);
						setMessage(message);
					}
					if (returnStatus == 0) {
						message = "No PTFs to install.";
						setState(MonitorState.OK);
						setMessage(message);
					}
					
					as400.disconnectAllServices();
					
					
				} catch (Exception e) {
					setMessage("MonitorAS400ptf failed \r" + e.getMessage());
					setState(MonitorState.CRIT);
				}
        }