*--------------------------------------------------------------------* * Copyright Sirius Software Inc. 2004 * * A L L R I G H T S R E S E R V E D * *--------------------------------------------------------------------* * Developed at: Sirius Software Inc. * * System: StatusMon * *--------------------------------------------------------------------* Begin %list Is Float %ucount Is Float %x Is Float %grabit Is String Len 120 %jinit Is String Len 255 %docstr Is Longstring %x = $setg('NEXT','LOG') * Socket initialization Call $Sock_set(1, 'PRSTOK', '00') Call $Sock_set(1, 'LINEND', '00') * Calculate system initialization date and time. %jinit = $usstat('CNCT',0) %jinit = $unbin($substr(%jinit,1,4)) %jinit = $sir_nm2date($sir_datenm - %jinit,'YY/MM/DD HH:MI:SS.XX') * Initialize an XML document. %doc Is Object XmlDoc %doc = New %nod Is Object XmlNode * Document node is "snapshot". %nod = %doc:AddElement('snapshot') * Add the system init time as an attribute to the document node. Call %nod:AddAttribute('inittime',%jinit) * Define a new XML Node in our document. %Y Is Object XmlNode * How many users are logged into the online? %list = $Listnew %x = $usstatl(%list,'TERMID') %ucount = $listcnt(%list) - $view('NSUBTKS') + 1 * Add "LoggedOnUsers" as a stat element. %Y = %nod:AddElement('stat',%ucount) Call %Y:Addattribute('name','LoggedOnUsers') %docstr = %doc:Xml Call $Sock_send(1,%docstr,'BINARY PUSH') * Call %doc:Print * Print %image END