Skip to main content

Hey All,

Is it possible to change the timeout on a Jamf Cloud console session?

We're on Jamf Cloud 10.42 using SSO to login to the console, if that matters.

The main issue (among others), is that when performing a GSX lookup, the web session usually times out before the look up finishes.

We have ~1400 workstations which takes at least 10-15 minutes to update, but more often than not results in a session timeout.  

I've tried creating a SMART group where there is no Warranty info for the device, but the only options are Warranty Expiration is before/after or within a certain # of days.

It does seem as though if I open a new JSS tab in the same browser window and work in there while the GSX lookup is ongoing in the other tab, that the GSX lookup session will not timeout.

I did check the SSO settings, but it only has a Token expiration time, which is not what I'm looking for.

 

Thanks for any thoughts.

Phil

Hi @pbenware1 I created https://github.com/fveja/JSSCaffeinate for this reason!  It works by keeping alive the web session.

Cheers,

Florin


Hi @pbenware1 I created https://github.com/fveja/JSSCaffeinate for this reason!  It works by keeping alive the web session.

Cheers,

Florin


Sweet.  TY, I will definitely give this a try.


Sweet.  TY, I will definitely give this a try.


Great!  Let me know how it works for you and what you think!


Worked for me.  Ran my GSX update with 0 timeouts.

But it does beg the question of why this can't be made longer or user configurable.


Worked for me.  Ran my GSX update with 0 timeouts.

But it does beg the question of why this can't be made longer or user configurable.


you can, if you move to dedicated instance..  $20k last time I looked.. 😱 (it does have some other 'stuff')


you can, if you move to dedicated instance..  $20k last time I looked.. 😱 (it does have some other 'stuff')


@jamf-42 Thanks for that.  I found the PDF for the Premium Cloud service.  Best guess is my org won't spring another $20K just to stop my complaining about timeouts, even with the other features.


@jamf-42 Thanks for that.  I found the PDF for the Premium Cloud service.  Best guess is my org won't spring another $20K just to stop my complaining about timeouts, even with the other features.


yea.. tuff one.. "but it will save 10mins a day!!" 🤣  was simple to do when on prem.. it should at least be an option (like you know every other admin panel!)  at least we have a new design on the config page! 


Hi @pbenware1 I created https://github.com/fveja/JSSCaffeinate for this reason!  It works by keeping alive the web session.

Cheers,

Florin


It's not working for me. Here's what I got when I try to run it:

./caffeinate.js: line 1: //: is a directory

./caffeinate.js: line 2: //: is a directory

./caffeinate.js: line 3: //: is a directory

./caffeinate.js: line 4: //: is a directory

./caffeinate.js: line 5: //: is a directory

./caffeinate.js: line 6: //: is a directory

./caffeinate.js: line 7: //: is a directory

./caffeinate.js: line 8: //: is a directory

./caffeinate.js: line 9: //: is a directory

./caffeinate.js: line 11: syntax error near unexpected token `'Started JSS Caffeinate. Running on ''

./caffeinate.js: line 11: `console.log('Started JSS Caffeinate. Running on ' + location.href)'

 

Maybe I am doing something wrong. Any advice?


It's not working for me. Here's what I got when I try to run it:

./caffeinate.js: line 1: //: is a directory

./caffeinate.js: line 2: //: is a directory

./caffeinate.js: line 3: //: is a directory

./caffeinate.js: line 4: //: is a directory

./caffeinate.js: line 5: //: is a directory

./caffeinate.js: line 6: //: is a directory

./caffeinate.js: line 7: //: is a directory

./caffeinate.js: line 8: //: is a directory

./caffeinate.js: line 9: //: is a directory

./caffeinate.js: line 11: syntax error near unexpected token `'Started JSS Caffeinate. Running on ''

./caffeinate.js: line 11: `console.log('Started JSS Caffeinate. Running on ' + location.href)'

 

Maybe I am doing something wrong. Any advice?


can't remember who made the JS.. but use Arc Browser.. setup a Boost and add this JS.. it works..


 


EDIT: oh it's the same code! Use Arc boost.. 😎


 


// ==UserScript==
// JSS Caffeinate
// @version 0.3
// @description Simulates mousedown events every few minutes, to activate keepalive call of JSS
// @match https://<yourJssUrlWithoutPort>/*
// @updateURL https://github.com/fveja/JSSCaffeinate/raw/main/JSS%20Caffeinate.js
// @noframes
// Florin Veja 2022
// ==/UserScript==

console.log('Started JSS Caffeinate. Running on ' + location.href)

// delay, in milliseconds, before we send mousedown event (120000 milliseconds = 2 min)
const delay = 120000
var last = Date.now()
const name = "JSS Caffeinate"

// set to true for debug console output
const jssCaffeinateDebug = false

// function to send us back to the
const login = () => {
debug("logging in")
location = location.origin
}

const debug = (m) => {
typeof jssCaffeinateDebug == 'boolean' &&
jssCaffeinateDebug &&
console.log(name + " debug: " + m)
}

const authExpiration = () => {
return JSON.parse(localStorage.authToken).expires - Date.now()
}

const getDelay = (max) => {
const min = 10000
return Math.random() * (max - min) + min
}

// if we are on the logout page, log back in
// randomize to not create a race
if (location.pathname == '/logout.html') {
setTimeout(login(), getDelay(10000))
}

const café = setInterval(() => {
var start = Date.now()
const mousedown = new Event('mousedown')
debug('JSS Caffeinate keepalive ' + start)
document.dispatchEvent(mousedown)
debug("authToken expires in " + authExpiration())
debug(last + " - " + start + "=" + (start - last))
last = start
if (authExpiration() < 1) { login() }
}, delay);

 


 


It's not working for me. Here's what I got when I try to run it:

./caffeinate.js: line 1: //: is a directory

./caffeinate.js: line 2: //: is a directory

./caffeinate.js: line 3: //: is a directory

./caffeinate.js: line 4: //: is a directory

./caffeinate.js: line 5: //: is a directory

./caffeinate.js: line 6: //: is a directory

./caffeinate.js: line 7: //: is a directory

./caffeinate.js: line 8: //: is a directory

./caffeinate.js: line 9: //: is a directory

./caffeinate.js: line 11: syntax error near unexpected token `'Started JSS Caffeinate. Running on ''

./caffeinate.js: line 11: `console.log('Started JSS Caffeinate. Running on ' + location.href)'

 

Maybe I am doing something wrong. Any advice?


What browser and what user-script plugin are you using?


@jamf-42 Thanks for that.  I found the PDF for the Premium Cloud service.  Best guess is my org won't spring another $20K just to stop my complaining about timeouts, even with the other features.


Is this still the only solution? I cannot find $20,000 to fix my technicians' frustrations.


@jamf-42 Thanks for that.  I found the PDF for the Premium Cloud service.  Best guess is my org won't spring another $20K just to stop my complaining about timeouts, even with the other features.

Is this still the only solution? I cannot find $20,000 to fix my technicians' frustrations.

Unfortunately, yes. I just spoke with Jamf’s support (after losing work for the 1,000th time 😡) and they confirmed that...by sending the PDF for Premium Cloud 🙄. It seems only a little bit ridiculous to require $20K to include this basic feature.


Here’s a pure AppleScript version.
 

#!/bin/bash

# 1.0.1 @pete_c 241216

# sh ./reload-jss.sh &

# automatically reload the JSS w/o any browser extensions
# note that you might get a TCC prompt on first run

# TO-DO: read jss_url from .plist, pass into the osascript

# kill any previous processes

if ps -ax | grep sh | awk '/reload-site/ { print $1 } ' >/dev/null; then

pkill -f "reload-site.sh"

fi


# trailing slash actually might not be required anymore? but port is if you're on prem

while true

do

osascript -e 'tell application "Google Chrome" to repeat with W in windows
reload (every tab in W whose URL is "https://your.jss.tld/") # trailing slash is required
end repeat'
sleep 500

done

exit 0

 


Reply