cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Difference between sessioncache.ssc and usagecache.ssc

Hi All,

based on
https://community.flexera.com/t5/FlexNet-Manager-Knowledge-Base/Software-Usage-Metering-How-to-monitor-unknown-product-known/tac-p/123561#M1277

and some other articles I was able to get results in the Raw Software Usage, also with Manual Mapper registry entries. Now I want to find out, how the upload was working, usageagent.log shows:
-----------------------------------------------------------------------------------------------------------------------
Backing up the session cache to
'C:\ProgramData\ManageSoft Corp\ManageSoft\Usage Agent\UsageData\sessioncache.ssc'

Next session backup in 3087.798372900 seconds (from SessionBackupPeriod preference)
Starting import of web data
Import of web data finished.
Deleted the session cache file
'C:\ProgramData\ManageSoft Corp\ManageSoft\Usage Agent\UsageData\sessioncache.ssc'

Wrote 0 remaining sessions to the session cache
Finished reading the session cache, sessions summarized to file
C:\ProgramData\ManageSoft Corp\ManageSoft\Usage Agent\UsageData\WinServer42 at 20191112T130944.mmi

Started uploading usage data
Started compressing usage data
Finished compressing usage data
About to start uploading file
'C:\ProgramData\ManageSoft Corp\ManageSoft\Common\Uploads\UsageData\WinServer42 at 20191112T130944.mmi.gz'

Execute “ndupload -r UsageData”
Execute returned “Started Successfully”.
Finished uploading usage data
Next upload in 39031.987631800 seconds (from UploadPeriod preference)
Usage agent finished
Program exited successfully
-----------------------------------------------------------------------------------------------------------------------

The command 'ndupload -r UsageData' is easy to understand, but can you please explain,
which command I can use to start the process "to move the data from the file sessioncache.ssc to the *.mmi file".
Then I must not wait during my testings.

I have also a second point. Some server has two *.ssc files: sessioncache.ssc and usagecache.ssc.
Can you please explain what that means, what is the difference?

Best regards

(1) Solution

There is no direct process to trigger the backing up of the session as this is handled using dlls run by the security agent service on Windows however there are ways to minimise the wait.

After generating a list of applications to track the usage agent will monitor for new executables that have been run for over 60 seconds.

It will record the usage initially in the sessioncache.ssc file and then at the scheduled session backup period it will be summarised into usagecache.ssc before finally being written to a .mmi file which is then uploaded.

 

The usage agent takes all of it's settings from HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ManageSoft Corp\ManageSoft\Usage Agent\CurrentVersion in the registry and here are some relevant ones based on what I describe above:

 

ProductUpdatePeriod - this is how often the usage agent refreshes the list of applications to monitor and defaults to 86400 seconds (24 hours)

ProcessUpdatePeriod - How often the agent checks for running executables (default 60 seconds)

MinRunTime - How long an executable needs to be the active window before we track the usage (default 60 seconds)

 

SessionBackupPeriod - this is how frequently sessioncache.ssc is backed up (default 3600 seconds or 1 hour) reducing this means usage is recorded locally ready for upload more often

UploadPeriod - how often the usage agent will upload the .mmi files (defaults to 86400 seconds which is 24 hours)

 

The main setting to have usage recorded more frequently is to reduce the SessionBackupPeriod although I would not recommend less than 10 minutes (600 seconds) as otherwise the other dependent processes may not have time to update.

Once the registry setting is changed, you'll need to restart the security agent service.

(Anything expressed here is my own view and not necessarily that of my employer, Flexera)
If the solution provided has helped, please mark it as such as this helps everyone to know what works.

View solution in original post

(6) Replies

There is no direct process to trigger the backing up of the session as this is handled using dlls run by the security agent service on Windows however there are ways to minimise the wait.

After generating a list of applications to track the usage agent will monitor for new executables that have been run for over 60 seconds.

It will record the usage initially in the sessioncache.ssc file and then at the scheduled session backup period it will be summarised into usagecache.ssc before finally being written to a .mmi file which is then uploaded.

 

The usage agent takes all of it's settings from HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ManageSoft Corp\ManageSoft\Usage Agent\CurrentVersion in the registry and here are some relevant ones based on what I describe above:

 

ProductUpdatePeriod - this is how often the usage agent refreshes the list of applications to monitor and defaults to 86400 seconds (24 hours)

ProcessUpdatePeriod - How often the agent checks for running executables (default 60 seconds)

MinRunTime - How long an executable needs to be the active window before we track the usage (default 60 seconds)

 

SessionBackupPeriod - this is how frequently sessioncache.ssc is backed up (default 3600 seconds or 1 hour) reducing this means usage is recorded locally ready for upload more often

UploadPeriod - how often the usage agent will upload the .mmi files (defaults to 86400 seconds which is 24 hours)

 

The main setting to have usage recorded more frequently is to reduce the SessionBackupPeriod although I would not recommend less than 10 minutes (600 seconds) as otherwise the other dependent processes may not have time to update.

Once the registry setting is changed, you'll need to restart the security agent service.

(Anything expressed here is my own view and not necessarily that of my employer, Flexera)
If the solution provided has helped, please mark it as such as this helps everyone to know what works.

@mrichardson 
Thanks a lot. I really appreciate your great support since the last years.

One last qustion:
I have done all changes in the registry manually on the server with the agent.
Is there way with a rule or a policy to push this configuration (e.g. enable: usage agent) from FNMS to the agent?

Partially yes, you can enable usage tracking via the UI using discovery and inventory rules.  If you look at the targets assigned to the rule there is an option to enable usage tracking in the properties of the target.

 

With the other settings I've mentioned, the only out of the box way is to modify the mgssetup files prior to installing them.

There is a way to push settings this using a database modification but caution is needed as if you get it wrong it can cause issues as there is no validation checking when using the DB option. 

I haven't tested the settings below but the following is likely to work although I would recommend a DB backup first:

 

Declare @targetID int;
Select @targetID = BeaconTargetID from BeaconTarget where Name = 'Target__windows'
IF EXISTS (Select BeaconTargetID from BeaconTargetPropertyValue where BeaconTargetID = @targetID and KeyName = 'CUsageAgentSessionBackupPeriod')
UPDATE BeaconTargetPropertyValue set Value = 600 where BeaconTargetID = @targetID and KeyName = 'CUsageAgentSessionBackupPeriod'
else
INSERT INTO BeaconTargetPropertyValue (BeaconTargetID, KeyName, Value) Values (@targetID, 'CUsageAgentSessionBackupPeriod', 600)

 


While I haven't tested this query specifically on the SessionBackupPeriod, I've used a similar one for other properties, the above will set the session to backup every 10 minutes (600 seconds).

 

The above only applies if you're on On-Premises.

(Anything expressed here is my own view and not necessarily that of my employer, Flexera)
If the solution provided has helped, please mark it as such as this helps everyone to know what works.

Thanks for the clarification.

I have asked because I saw this page:
https://helpnet.flexerasoftware.com/fnms/EN/WebHelp/index.html#topics/Disco-Raw_Soft_Usage.html
--------------------------------------------------------------------------------------------------------------------------------------------
In addition, it requires that the FlexNet inventory agent has the application usage tracking component enabled (by default, it is disabled). For inventory devices managed by policy downloaded from an inventory beacon, navigate to Discovery & Inventory > Discovery and Inventory Rules > Targets tab, and ensure that each intended inventory device is included in at least one target that has Allow application usage tracking on these targets selected
--------------------------------------------------------------------------------------------------------------------------------------------

The section you refer to is what I mentioned previously where I said you can enable or disable usage tracking itself centrally, it's only the usage preferences that can't be set in the UI and needs a DB change.

(Anything expressed here is my own view and not necessarily that of my employer, Flexera)
If the solution provided has helped, please mark it as such as this helps everyone to know what works.

As I understand on the target I have to activate it like: "Allow application usage tracking on these targets"

Two questions I have  now is which actions do I need:

Section Discovery of Devices:  what needs to be selected  ?

and

Section: Tasks for services discovery and inventory gathering:  what is need to be selected ?

In this particularly for a windows device

Please advise in this

Kind regards Frank