Syed Jahanzaib Personal Blog to Share Knowledge !

August 26, 2014

Graphing FREERADIUS Online Users via MRTG

Filed under: Linux Related, Radius Manager — Tags: , — Syed Jahanzaib / Pinochio~:) @ 10:34 AM

Last Updated: 23-JUN-2016 / 11:20 am


Recently at a network where multiple NAS were implemented with single centralized billing system(radius Manager with Free radius as backend engine) , I configured MRTG to create graphs for each NAS and added Mikrotik DUDE system to monitor various instances of the target systems, but there was no single graph to monitor overall ONLINE users of all NASES.

MRTG was configured on main Billing system, to sort this I used the following bash script and tag it with the mrtg cfg script.


First create the script

mkdir /temp
touch /temp/

chmod +x /temp/
nano /temp/

Now paste the following code, [make sure to change the IP, ID and Password]

Note: I used this script for Radius Manager base freeradius billing system.

# Script to query online conencted users in freeradius
# Syed Jahanzaib / aacable at hotmail dot com
# http://aacable . wordpress . com
# acquire online users whose accnt-stop time is null so consider it online : )
SESSIONS=<code>mysql -u$SQLUSER -p$SQLPASS --skip-column-names -e "use radius; SELECT username FROM $SQL_ACCOUNTING_TABLE WHERE acctstoptime IS NULL;" |wc -l`</code> echo $SESSIONS echo $SESSIONS 

Save & Exit.


Now create a MRTG cfg file and tag it with your master mrtg config file or run it as individual , its up to you and your local design.

# Total Radius Users
Target[Radius.users]: `/temp/`
Title[Radius.users]: Central Billing System Logged in Users by ZAIB (Total)
<H1> Central Billing System  Logged in Users (Total)</H1>

MaxBytes[Radius.users]: 1000
Colours[Radius.users]: B#8888ff,B#8888ff,B#5398ff,B#5398ff
Options[Radius.users]: gauge,nopercent,noo,integer,growright
LegendI[Radius.users]: Radius Logged in Users
YLegend[Radius.users]: Radius Logged in Users (Total)
Legend1[Radius.users]: Radius Logged in Users (Total)
Unscaled[Radius.users]: ymwd

Syed Jahanzaib

August 18, 2014

Vmware ESXI: You cannot use the vSphere client to edit the settings of virtual machines of version 10 or higher

Filed under: VMware Related — Tags: , — Syed Jahanzaib / Pinochio~:) @ 10:38 AM

Few days back, At remote location, when I converted a physical Linux machine into virtual machine (based on ESXI 5.5 , machine ver 10) I received following error when tried to edit its properties to add new interface card.

Editing virtual machine settings fails with the error: You cannot use the vSphere client to edit the settings of virtual machines of version 10 or higher ...



I had the option to downgrade it using v-converter client, but Time was really short as whole network was down and old physical machine was also out of order, so I used following hack to add the interface quickly and make it online.


  • Turn OFF the required Guest,
  • Remove the guest from the inventory (Right-click -> remove from inventory)
  • Browse your ESXI datastore where guest files are placed,
  • Now Download the .vmx file from your the location where your guest files are placed (Example guest’s name.vmx file)
  • Open it in any text editor (Example NOTEPAD PLUS+),
  • Change the following … 

virtualHW.version = “10”



virtualHW.version = “8”

As showed in the image below …


  • Save this file and upload back to original location.
  • Add the guest back to your inventory by right clicking the vmx file and selecting “Add to inventory”

Now try to edit the guest properties, and this time you will be able to do it.

There were some other workarounds too but in that particular situation, I found this method the most quickest and above all it worked well 🙂


Syed Jahanzaib

%d bloggers like this: