JAMF PRO Monitoring

mykool
New Contributor III

Does anyone have a good way to monitor their JAMF Pro hosted environment? Some way to get alerted that a connection to the JSS is failing? This seems to be an ongoing issue for us lately (connection to the JSS is not available) and I was looking for a way to know about it before users start to complain. 

 

Thanks,

6 REPLIES 6

henryxyz
New Contributor III

For Linux on-premise, we used Datadog to monitor the systems.  We are alerted when Java Heap was high or the URL was not available.  This requires you have money to pay for Datadog.  If you are looking for something more home grown, you can create a script running on the server that checks the healthCheck.html and than sends an email when it is not available.  Creating a home grown script will require you have a way to forward email from the server as well as a local email application on the server.  If you just want to monitor manually and from your desktop, below is a snippet of a bash script you can use as a beginnings of a simple script you can run on your macOS desktop.  Make it run in a loop using "while :  - do  - done" if on macOS. 

#! /bin/bash

while :

do

Echo -n "Status Principal Server ===>"
curl -k -m 5 -s https://servername.company.com:8443/healthCheck.html
serverstat01=$(echo $?)

# do not put anything between the curl command above and the variable that collects the output
if [ ! $serverstat01 = '0' ]; then echo -n "ERROR from curl is: $serverstat01" ; fi
echo " "

sleep 5

done

tlarkin
Honored Contributor

I use webhooks to monitor client events, but we are Jamf cloud so the actual infra monitoring is Jamf's problem not mine.  I wrote a mini series of blog posts about it, here is part 3 which dives into more of monitoring assets than just jamf cloud itself, but the concepts I think can be applied to many other things. here  is the blog post.

MartinB
New Contributor II

Maybe JavaMelody is what you are looking for: https://github.com/javamelody/javamelody/wiki

I tested it, it's easy to install and offers a lot of information regarding health, warnings and errors.

grahamrpugh
Release Candidate Programs Tester

Hi Martin, I have just been trying to install JavaMelody and am failing. I wonder if you can share how you made it work? 

I followed instructions here and here on how to deploy it (basically just copy the jar files to the WEB-INF/lib file of each webapp, and add a role into web.xml, as far as I can tell). But I'm getting a "not found" for the https://myserver:8443/context/monitoring URL.

MartinB
New Contributor II

Hi Graham,

sorry for the late reply to your question.

I just tested the installation of JavaMelody again, because the last installation and experience was from 2018.

There are at least  two files that you have to configure:

The web.xml file

I added the following code after the <web-app> configuration:

.

.

.

<filter>
<filter-name>javamelody</filter-name>
<filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
<async-supported>true</async-supported>
</filter>
<filter-mapping>
<filter-name>javamelody</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ASYNC</dispatcher>
</filter-mapping>
<listener>
<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Monitoring</realm-name>
</login-config>
<security-role>
<role-name>monitoring</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>Monitoring</web-resource-name>
<url-pattern>/monitoring</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>monitoring</role-name>
</auth-constraint>
</security-constraint>

 

<display-name><![CDATA[jamf Pro Version 10.39.1<br />
java version "11.0.15" 2022-04-19 LTS<br />
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)<br />
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1, mixed mode, sharing)<br />]]>
</display-name>

.

.

.

The <display-name> part is not necessary, but adds an information line on top of the window.

The tomcat-users.xml file

I added the following role and user:

.

.

.

<role rolename="monitoring"/>

<user username="monitoring" password="monitoring2022!" roles="monitoring"/>

.

.

.

That was all, you can have a look at the result here: https://nms.hamburg:8443/jss/monitoring

I'll leave this link active for some days only.

Good luck and best regards

 

Martin

 

grahamrpugh
Release Candidate Programs Tester

Hi Martin, thanks for that. In fact, it turned out that all we had to do differently was set the ownership of the two WAR files to `tomcat8:tomcat8`. Didn't think of this!