Jump to content


Photo

Resident Agent - Automatic Update - How?


  • Please log in to reply
8 replies to this topic

#1 bwgfoods

bwgfoods

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 04 August 2017 - 01:50 AM

I've setup the resident agent on a PC and configured a HTTP location for updates.

 

the agent detects the updates in the HTTP location, downloads the new .ini file and creates an 'update.bat' file like below:

 

net stop TNIResidentAgent
del /F /Q "C:\Windows\TNI Resident Agent\tniwinagent.ini"
ren "C:\Windows\TNI Resident Agent\tniwinagent_update.ini" tniwinagent.ini
net start TNIResidentAgent
del "C:\Windows\TNI Resident Agent\update.bat
 
 
My question - what executes the batch file? It just sits there and never updates - what am I missing?


#2 Alex

Alex

    Support

  • Administrators
  • PipPipPip
  • 128 posts
  • Gender:Male

Posted 04 August 2017 - 03:42 AM

Hello,

Thanks for your message.

After the update.bat file is created, the TNIResidentAgent service executes the following command:
cmd.exe /C C:\path\to\file\update.bat



#3 bwgfoods

bwgfoods

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 08 August 2017 - 01:09 AM

Well it's not working then - 

 

The old .ini file does not get deleted, the new .ini file does not get renamed and the .bat file is still there - 5 days after being created.

 

there's noting in the event log on the server - is there a log for the resident agent service?



#4 Alex

Alex

    Support

  • Administrators
  • PipPipPip
  • 128 posts
  • Gender:Male

Posted 09 August 2017 - 05:57 AM

Hello,

Sorry for the delay.

This problem occurs because the name of the resident agent folder has spaces in it. Please try renaming this folder and make sure that there are no spaces anywhere in the path.

We’ll fix this problem in one of the upcoming updates.



#5 bwgfoods

bwgfoods

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 12 September 2017 - 12:38 PM

OK, this is painful.

 

I've stopped and unregistered the service, renamed the folder to c:\TNIResidentAgent (no spaces), re-installed and restarted the agent,

 

Now, the application attempts to download the update but just doesn't do it - no log entries, nothing to diagnose from - just this in the log file:

 

 
2017.09.12 21:17:54:010 Starting service...
2017.09.12 21:20:02:286 Scheduler: downloaded new settings
2017.09.12 21:25:02:260 Scheduler: starting scan...
 
..but nothing downloads
 
Help!!!


#6 bwgfoods

bwgfoods

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 13 September 2017 - 02:03 AM

type above - folder is C:\Windows\TNIResidentAgent



#7 Alex

Alex

    Support

  • Administrators
  • PipPipPip
  • 128 posts
  • Gender:Male

Posted 14 September 2017 - 06:13 AM

Hello,

Most likely that the program downloads the update, then sees that the updated .ini file has the same timestamp as the current one, and therefore, the update is not applied. If the config-timestamp parameter differs from the current one and contains a more recent date, the following line will appear in the log:
Scheduler: downloaded settings are newer, need to update

Please make sure that you have exported the agent with the updated tniwinagent.ini file from the Resident agent tab in Options.
Alternatively, you can manually update the config-timestamp parameter of the tniwinagent.ini file.



#8 bwgfoods

bwgfoods

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 18 September 2017 - 02:25 AM

Not the case:

 

Local tniwinagent.ini:

config-timestamp=20170810165919.164000+060

 

Remote one:

config-timestamp=20170913115318.224000+060

 

I've monitored the local folder and nothing gets written to the folder, no errors in the event log, permissions on the folder have been triple-checked.

 

What next???

 

Tail of log file from this morning:

 

2017.09.18 10:50:47:747 Scheduler: starting scan...
2017.09.18 10:50:47:748 Starting local scan...
2017.09.18 10:51:42:616 Scan finished
2017.09.18 10:51:42:617 Sending data via FTP...
2017.09.18 10:51:57:782 Data sent successfully, local data moved to "Sent"
2017.09.18 10:55:47:757 Scheduler: downloaded new settings
2017.09.18 11:00:47:734 Scheduler: starting scan...
2017.09.18 11:00:47:735 Starting local scan...
2017.09.18 11:01:34:239 Scan finished
2017.09.18 11:01:34:240 Sending data via FTP...
2017.09.18 11:01:40:370 Data sent successfully, local data moved to "Sent"
2017.09.18 11:05:48:884 Scheduler: downloaded new settings
2017.09.18 11:10:47:703 Scheduler: starting scan...
2017.09.18 11:10:47:704 Starting local scan...
2017.09.18 11:11:42:433 Scan finished
2017.09.18 11:11:42:434 Sending data via FTP...
2017.09.18 11:11:50:726 Data sent successfully, local data moved to "Sent"
2017.09.18 11:15:48:396 Scheduler: downloaded new settings
2017.09.18 11:20:47:718 Scheduler: starting scan...
2017.09.18 11:20:47:719 Starting local scan...


#9 Alex

Alex

    Support

  • Administrators
  • PipPipPip
  • 128 posts
  • Gender:Male

Posted 04 October 2017 - 07:16 AM

After a few messages via email, we managed to find out what was causing the problem in this case. The webserver was configured to not serve up .ini files. As a result, the tniwinagent was unable to update the configuration file, as it uses the same HTTP GET request as any browser.

To solve the problem, you can use the .txt extension for the configuration file. You can specify the extenstion manually by opening the program Options while holding down the Alt key. A new field “Custom INI name” will become visible on the Resident agent page.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users