Article
The recommended Best Practices is to remove devices that are no longer being used. And to keep the number of devices down to less than 150 per server. I had an issue where users were testing out different devices then stop using them and not asking us to remove the device. And via the Web console it is very difficult to find devices that are no longer being used.
To fix that I wrote a simple script to query the Mobility Database and write that information to a Web Page. The script is below.
With the upgrade to version 1.2.5 you can have about 750 devices now. Also the schema has changed. I have added the changes to the script to query version 1.2.5.
- I created a script in /usr/local/sbin with a name of devices.sh
#!/bin/sh export PGPASSWORD=xxxxxx psql mobility -c "select userid,tstamp,devicetype,identifierstring from devices order by userid;" -U datasync_user -H -o /tmp/devices.html scp /tmp/devices.html user@hostname.com:/srv/www/htdocs Note: If running 1.2.5 use the line below. psql mobility -c "SELECT name,tstamp,devicetype,identifierstring FROM devices, users WHERE devices.userid=guid order by name;" -U datasync_user -H -o /tmp/devices.html
You will need to know the password for the mobility database, you set it when installed Datasync. That password goes in place of xxxxx in the export PGPASSWORD line.
The last line of the script scp's devices.html to one of our web servers. I used trusted keys between our Linux servers so no password is required.
- Add the following to your crontab. I run the script every 15 minutes.
*/15 * * * * /usr/local/sbin/devices.sh
If you look at the output you can see all the devices. You can tell which devices are no longer being used by looking at the tstamp (Time Stamp). You can contact the user and ask him to remove his account from that device. And then you can delete the device from Data Sync.
There are other fields you can query. Those are:
userid
deviceid
identifierstring
description
devicetype
configtype
deviceconfig
pingrequest
pingresponseflag
state
statedata
tstamp
Have fun!
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.
Related Articles
User Comments
Find devices no longer contacting Datasync
Submitted by jwardza on 20 January 2011 - 10:04am.
We have many users who like to add devices to Datasync but never tell us when they stop using them. I worte this script to find devices no longer is use.
- Be the first to comment! To leave a comment you need to Login or Register
Find Old devices script
Submitted by floort on 28 January 2011 - 2:20pm.
Very cool, i'm going to test the script.
I hope novell will make something like this inside the datasync webinterface.
Thanks.
- Be the first to comment! To leave a comment you need to Login or Register
Thank you very much....
Submitted by laurabuckley on 16 February 2011 - 5:09am.
This script is just what I needed. Would be nice if Novell gave us the functionality native in the web interface ;-)
- Be the first to comment! To leave a comment you need to Login or Register



3