![]() I would avoid Ping as it simply doesn't tell you enough about the state of the service. ![]() My function works for HTTP services, if I needed to test SMB, FTP to other protocols (or any connection other than the usual web ports), I would agree with those recommending NetCat above. One of the additional benefits of this method as you are testing not only for the client to have a viable route to the service, but also that the service is running on the server. If it's not available, then you'll get the usual 403, 404, 500, etc. If the website "$FilerURL/" (for bonus points, you could set the variable to $4-$11 and define those in the JSS interface) is online, then the above function will return "200". Here is the code I use in several scripts: Verif圜onnection() Instead, I might suggest that you scope the policy to machines regardless of network state, and then build code into the script to determine action based on network state. But even if your JSS is reachable externally, network state can change multiple times between scheduled recons, especially in a VPN setting, so the extension attribute is likely to always be out of date. Since extension attributes are only updated on recon, if you don't have your JSS available externally, the attribute will always show as being on network. So, I would need to know more about the specifics you are trying to do, but I don't know if I think network state as an extension attribute is the best solution. Configure the following settings: Name your extension attribute. Extension attribute values are populated by using an input type, which can be any of the. I just don't know how to write this syntax In the top-right corner of the page, click Settings. Extension attributes allow you to collect extra inventory information. I know a status of 0 on exit means I can successfully ping the server. # my goal here is to send 2 pings to a given internal server. ![]() If the device cannot ping this site, then it is off the network. Create a smart group to send email notifications if that condition is not met. bin/bash currentUser (/usr/bin/stat -f 'Su' /dev/console. once you update your Extension attribute you should be able to run sudo jamf recon on your test machine to see the results right away. Use the script to trigger a policy if a certain condition is not met. I just tried this on my test server and it is working, had to clean up the script a little to get it to work. When the extension attribute finds a match, it reports the result to the Jamf Software Server (JSS). This Extension Attribute will let me know whether it is possible to ping a specific only on the network site. Write a script for a computer extension attribute using the information from modules in the Scripting Series. Given the wide swath of 10.x.x.x IPs that we use here (some are internal on the network, others are guest off the network), and the logic to that is hard to boil down easily, I have decided to go at this with an extension attribute.īasically the extension attribute would go something like this: So my goal here is to create a simple extension attribute that will tell me whether a device is on or off the network.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |