Friday, June 8, 2012

Policy Server Status and Batch file scheduling

This post is mainly for knowing policy server status and scheduling batch file to print policy server status on smps log every 5 mins.

To print policy server status use simple command "smpolicysrv -stats"

Batch file: (Open notepad, copy and paste below 6 lines and save as status.bat)


@echo off
REM - File: SiteMinderPolicyServerstatus.bat
REM - Description: SiteMinder Policy Server status
echo SiteMinder Policy Server status
smpolicysrv -stats
echo status printed


To test batch file just open command prompt and run the batch file. Following lines should be printed in smps log


[2148/3352][Thu Jun 07 2012 22:23:05][CServer.cpp:7457][INFO] Server 'Stats' command received
[2148/3352][Thu Jun 07 2012 22:23:05][CServer.cpp:4662][INFO] ===================================================================================
[2148/3352][Thu Jun 07 2012 22:23:05][CServer.cpp:4663][INFO] System Statistics
[2148/3352][Thu Jun 07 2012 22:23:05][CServer.cpp:4680][INFO] Thread pool limit: 8
[2148/3352][Thu Jun 07 2012 22:23:05][CServer.cpp:4700][INFO] Thread pool: Msgs=6 Waits= 6 Misses=  2 Max HP Msg=   1 Max NP Msg=    1 Current Depth=     0 Max Depth=      1 Current High Depth=       0 Current Norm Depth=        0 Current Threads=         2 Max Threads=          2
[2148/3352][Thu Jun 07 2012 22:23:05][CServer.cpp:4708][INFO] Connections: Current=0 Max= 2 Limit=256 Exceeded limit=   0
[2148/3352][Thu Jun 07 2012 22:23:05][CServer.cpp:4711][INFO] ===================================================================================



Upto now we have seen how to create batch for printing status. Now we will see how to schedule batch file every five minutes so that policy server status will get printed in smps log every 5 mins.


1) Go to task scheduler as shown in figure 1


Figure 1
2) click on create task as shown in figure 2

Figure 2
 3) Give some name go to triggers tab as shown in figure 3
Figure 3
 4) click new in triggers tab as shown in figure 4


Figure 4
 5)  select daily, recur every 1 day, Repeat task every 5 mins, for duration of "select indefnetly", check enabled as shown in figure 5 and click ok


Figure 5
 6) go to actions tab and click new as shown in figure 6


Figure 6

 7) select path of script by clicking on browse and click ok as shown in figure 7
Figure 7

8) And click ok, batch will run every 5 mins and status will get printed every 5 mins in smps log.


Thanks !!!

No comments:

Post a Comment

Other Posts