Collecting infos of DSS in Cacti
juil 10th, 2007 by Prune
I had some time yesteday to add DSS monitoring into Cacti SNMP Monitoring tool.
I decided to break the data collection into 2 separate graphs : one for current number of connections and one for current server bandwidth. Of course you will add other host graph, like NIC bandwidth and CPU to get a real view of your server’s health.
So far, here is what you will have :


When I have my whole architecture up and running I will go for data aggregation to get the full connections over all servers.
You will find 2 Cacti Graph Templates in the download section, with the 2 python scripts to collect data.
The python scripts have to be copied in the cacti/scripts directory, while the XML files have to be imported using the “Import Template” link in the Cacti Console.
Bandwidth template and script
Connection template an script
For the python scripts to work, you will have to enable the “remote admin” in DSS. Change this in your streamingserver.xml file :
- set LocalAccessOnly to false
- add your IP’s in the IPAccessList
- check enable_remote_admin is true, which is the default
- use your admin user or add anoter one in the admin group using qtpasswd
<MODULE NAME="QTSSAdminModule" > <PREF NAME="IPAccessList" >10.16.248.10</PREF> <PREF NAME="Authenticate" TYPE="Bool16" >true</PREF> <PREF NAME="LocalAccessOnly" TYPE="Bool16" >false</PREF> <PREF NAME="RequestTimeIntervalMilli" TYPE="UInt32" >50</PREF> <PREF NAME="enable_remote_admin" TYPE="Bool16" >true</PREF> <PREF NAME="AdministratorGroup" >admin</PREF> </MODULE>
In this case your remote IP is 10.16.248.10
You can define multiple IP’s like this :
<MODULE NAME="QTSSAdminModule" > <LIST-PREF NAME="IPAccessList" > <VALUE>127.0.0.*</VALUE> <VALUE>10.16.248.*</VALUE> </LIST-PREF> <PREF NAME="Authenticate" TYPE="Bool16" >true</PREF> <PREF NAME="LocalAccessOnly" TYPE="Bool16" >false</PREF> <PREF NAME="RequestTimeIntervalMilli" TYPE="UInt32" >50</PREF> <PREF NAME="enable_remote_admin" TYPE="Bool16" >true</PREF> <PREF NAME="AdministratorGroup" >admin</PREF> </MODULE>
I also provide a simple python script to get easily any DSS Admin URL : dss-query_url.py
The usage is simple (but you may have to add python before it or change the python link in the first line of the script). You just need to provide the hostname, the port (554), the login of an admin account (the account you use to log in the HTML interface - the one you define at the install stage) and its password.
The you can supply any URL. You will learn more about Admin URL in the “Documentation/admin-protocol-README.txt” file in the source tree.
You will also find some usefull informations on each fields in the file “APIStubLib/QTSS.h”.
Let’s have an example :
python dss-query_url.py myhost.mydomain.com 554 admin password /modules/admin/server/*?command=get Container="/admin/server/" qtssServerAPIVersion="262144" qtssSvrDefaultDNSName="0.0.0.0" qtssSvrDefaultIPAddr="0" qtssSvrServerName="DSS" qtssRTSPSvrServerVersion="5.5.5" qtssRTSPSvrServerBuildDate="Jul 6 2007, 16:35:39" qtssSvrRTSPServerHeader="Server: DSS/5.5.5 (Build/489.16; Platform/Solaris; Release/Darwin; state/beta; )" qtssSvrState="1" qtssSvrIsOutOfDescriptors="false" qtssRTSPCurrentSessionCount="127" qtssRTSPHTTPCurrentSessionCount="0" qtssRTPSvrNumUDPSockets="8" qtssRTPSvrCurConn="126" qtssRTPSvrTotalConn="256" qtssRTPSvrCurBandwidth="5027784" qtssRTPSvrTotalBytes="3809807612" qtssRTPSvrAvgBandwidth="3247539" qtssRTPSvrCurPackets="776" qtssRTPSvrTotalPackets="10865424" qtssSvrStartupTime="1183999975017" qtssSvrGMTOffsetInHrs="-20629" qtssSvrDefaultIPAddrStr="0.0.0.0" qtssSvrCurrentTimeMilliseconds="1184070706181" qtssSvrCPULoadPercent="23.004150" qtssSvrNumReliableUDPBuffers="0" qtssSvrReliableUDPWastageInBytes="0" qtssMP3SvrCurConn="0" qtssMP3SvrTotalConn="0" qtssMP3SvrCurBandwidth="0" qtssMP3SvrTotalBytes="0" qtssMP3SvrAvgBandwidth="0" qtssSvrServerBuild="489.16" qtssSvrServerPlatform="Solaris" qtssSvrRTSPServerComment="Release/Darwin; state/beta; " qtssSvrNumThinned="113" qtssSvrRTSPPorts/ qtssSvrHandledMethods/ qtssSvrModuleObjects/ qtssSvrPreferences/ qtssSvrMessages/ qtssSvrClientSessions/ qtssSvrConnectedUsers/ error:(0)
Quoting the “APIStubLib/QTSS.h” file :
// These parameters ARE pre-emptive safe. qtssServerAPIVersion = 0, //read //UInt32 //The API version supported by this server (format 0xMMMMmmmm, where M=major version, m=minor version) qtssSvrDefaultDNSName = 1, //read //char array //The "default" DNS name of the server qtssSvrDefaultIPAddr = 2, //read //UInt32 //The "default" IP address of the server qtssSvrServerName = 3, //read //char array //Name of the server qtssSvrServerVersion = 4, //read //char array //Version of the server qtssSvrServerBuildDate = 5, //read //char array //When was the server built? qtssSvrRTSPPorts = 6, //read // NOT PREEMPTIVE SAFE!//UInt16 //Indexed parameter: all the ports the server is listening on qtssSvrRTSPServerHeader = 7, //read //char array //Server: header that the server uses to respond to RTSP clients // These parameters are NOT pre-emptive safe, they cannot be accessed // via. QTSS_GetValuePtr. Some exceptions noted below qtssSvrState = 8, //r/w //QTSS_ServerState //The current state of the server. If a module sets the server state, the server will respond in the appropriate fashion. Setting to qtssRefusingCon nectionsState causes the server to refuse connections, setting to qtssFatalErrorState or qtssShuttingDownState causes the server to quit. qtssSvrIsOutOfDescriptors = 9, //read //Bool16 //true if the server has run out of file descriptors, false otherwise qtssRTSPCurrentSessionCount = 10, //read //UInt32 //Current number of connected clients over standard RTSP qtssRTSPHTTPCurrentSessionCount = 11, //read //UInt32 //Current number of connected clients over RTSP / HTTP qtssRTPSvrNumUDPSockets = 12, //read //UInt32 //Number of UDP sockets currently being used by the server qtssRTPSvrCurConn = 13, //read //UInt32 //Number of clients currently connected to the server qtssRTPSvrTotalConn = 14, //read //UInt32 //Total number of clients since startup qtssRTPSvrCurBandwidth = 15, //read //UInt32 //Current bandwidth being output by the server in bits per second qtssRTPSvrTotalBytes = 16, //read //UInt64 //Total number of bytes served since startup qtssRTPSvrAvgBandwidth = 17, //read //UInt32 //Average bandwidth being output by the server in bits per second qtssRTPSvrCurPackets = 18, //read //UInt32 //Current packets per second being output by the server qtssRTPSvrTotalPackets = 19, //read //UInt64 //Total number of bytes served since startup qtssSvrHandledMethods = 20, //r/w //QTSS_RTSPMethod //The methods that the server supports. Modules should append the methods they support to this attribute in their QTSS_Initialize_Role. qtssSvrModuleObjects = 21, //read // this IS PREMPTIVE SAFE! //QTSS_ModuleObject // A module object representing each module qtssSvrStartupTime = 22, //read //QTSS_TimeVal //Time the server started up qtssSvrGMTOffsetInHrs = 23, //read //SInt32 //Server time zone (offset from GMT in hours) qtssSvrDefaultIPAddrStr = 24, //read //char array //The "default" IP address of the server as a string qtssSvrPreferences = 25, //read //QTSS_PrefsObject // An object representing each the server's preferences qtssSvrMessages = 26, //read //QTSS_Object // An object containing the server's error messages. qtssSvrClientSessions = 27, //read //QTSS_Object // An object containing all client sessions stored as indexed QTSS_ClientSessionObject(s). qtssSvrCurrentTimeMilliseconds = 28, //read //QTSS_TimeVal //Server's current time in milliseconds. Retrieving this attribute is equivalent to calling QTSS_Milliseconds qtssSvrCPULoadPercent = 29, //read //Float32 //Current % CPU being used by the server qtssSvrNumReliableUDPBuffers = 30, //read //UInt32 //Number of buffers currently allocated for UDP retransmits qtssSvrReliableUDPWastageInBytes= 31, //read //UInt32 //Amount of data in the reliable UDP buffers being wasted qtssSvrConnectedUsers = 32, //r/w //QTSS_Object //List of connected user sessions (updated by modules for their sessions) qtssMP3SvrCurConn = 33, //r/w //UInt32 //Number of MP3 client sessions connected qtssMP3SvrTotalConn = 34, //r/w //UInt32 //Total number of MP3 clients since startup qtssMP3SvrCurBandwidth = 35, //r/w //UInt32 //Current MP3 bandwidth being output by the server in bits per second qtssMP3SvrTotalBytes = 36, //r/w //UInt64 //Total number of MP3 bytes served since startup qtssMP3SvrAvgBandwidth = 37, //r/w //UInt32 //Average MP3 bandwidth being output by the server in bits per second qtssSvrServerBuild = 38, //read //char array //build of the server qtssSvrServerPlatform = 39, //read //char array //Platform (OS) of the server qtssSvrRTSPServerComment = 40, //read //char array //RTSP comment for the server header qtssSvrNumThinned = 41, //r/w //SInt32 //Number of thinned sessions qtssSvrNumParams = 42 };
[UPDATE]
There is a problem inside my template, where the max value of the bandwidth is too low.
If you have already created some graphs, you can use the rrdtool to change this :
/opt/monitor/rrdtool-1.2.12/bin/rrdtool tune /opt/monitor/apache/htdocs/cacti/rra/cygnusadm_qtssrtpsvrbandwidth_1187.rrd --maximum "qtssRTPSvrBandwidth:1e+12" /opt/monitor/rrdtool-1.2.12/bin/rrdtool tune /opt/monitor/apache/htdocs/cacti/rra/cygnusadm_qtssrtpsvrbandwidth_1187.rrd --maximum "qtssMP3SvrBandwidth:1e+12"
10e+12 may be a bit high, but you won’t get any problem even with a loaded server
If you haven’t created any graphs yet, change the Cacti Data Template for DSS - Current Bandwidth.
For each Data Source Item, change the Maximum Value to 100000000000 like this :

If you haven’t imported the template yet, download it again, I changed it today (20070711)
Please excuse me for the mistake.