search cancel

Function GET_FILESYSTEM fails on Windows on the drive where the swap file of the OS is located

book

Article ID: 202378

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

We can reproduce this behavior in house in Automic Engine version '12.3.3+build.1591966211565 and Windows agent version version '12.3.3+build.1591976936160'

1. create script object with the following script in process tab
:SET &AGENT#="WIN01"
:set &LOGIN#="LOGIN.NEW.2"
:SET &DRIVE#="C:*"

: SET &TOTAL# = GET_FILESYSTEM(&AGENT#,&DRIVE#,FILESYSTEM_SPACE_TOTAL,GB,"N",&LOGIN#)
: SET &ERRNR# = SYS_LAST_ERR_NR
: IF &ERRNR# > 0
: SET &ERRINS# = SYS_LAST_ERR_INS
: SET &MESSAGE# = GET_MSG_TXT (&ERRNR#,&ERRINS#)
: P &MESSAGE#
: ENDIF

: SET &USED# = GET_FILESYSTEM(&AGENT#,&DRIVE#,FILESYSTEM_SPACE_USED,GB,"N")
: SET &ERRNR# = SYS_LAST_ERR_NR
: IF &ERRNR# > 0
: SET &ERRINS# = SYS_LAST_ERR_INS
: SET &MESSAGE# = GET_MSG_TXT (&ERRNR#,&ERRINS#)
: P &MESSAGE#
: ENDIF
: P "Agent &AGENT# Drive &DRIVE# Used: &USED# OF &TOTAL#"

2. Please note that the &AGENT# and &LOGIN# are hard coded so make the necesary changes to adapt it.The LOGIN.NEW.2 has administrator as the login user.

3. Execute the script and we can see the following in the last report

2020-08-11 09:38:10 - U00020408 U00011700 Cannot find information for path 'C:\'.
2020-08-11 09:38:10 - U00020408 U00011700 Cannot find information for path 'C:\'.
2020-08-11 09:38:10 - U00020408 Agent WIN01 Drive C:\ Used: 0000000000000000 OF 0000000000000000

4. We can see the following in the agent log
20200811/150810.648 - U02000234 File Event with RunID '1052003' has been started in Thread '7492'.
20200811/150810.648 - U00065012 Event '1052003' unable to get information for file 'C:\pagefile.sys', reason '32 - The process cannot access the file because it is being used by another process. >Attributes.cpp#sys::Attributes::readBasicFileAttributes:663<'.
20200811/150810.648 - U02000135 Thread '7492' ended.

5. Now make the change to point the &DRIVE#="C:\Automic" and then save and execute the script.We can see in the last report that it works
2020-08-11 09:40:44 - U00020408 Agent WIN01 Drive C:\Automic Used: 0000000000000027 OF 0000000000000060

6. Agent logs also shows no errors
20200811/151044.696 - U02000234 File Event with RunID '1052004' has been started in Thread '2928'.
20200811/151044.696 - U02000135 Thread '2928' ended.

Expected behavior:
The GET_FILESYSTEM should work for c:\

Environment

Release : 12.3

Component : AUTOMATION ENGINE

Resolution

This is a bug and it will be fixed in a future release

Workaround

It works if we include a folder under c:\
&DRIVE#="C:\Automic" and then save and execute the script.We can see in the last report that it works
2020-08-11 09:40:44 - U00020408 Agent WIN01 Drive C:\Automic Used: 0000000000000027 OF 0000000000000060