How can I get MID server agent absolute path in MID Server Script includes

AW1
Tera Contributor

We have MID servers setup on different OS, one on Windows and one on UNIX. In MID Server Script included a path is needed to get a file on the export directory of the mid server agent directory. What command can I use to get the file directory that will work for both Windows and Linux? Thanks

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

If you want it on SN then you can go to ecc_agent.list and get home_dir field.

Run below in background script and see what you get.

var gr = new GlideRecord("ecc_agent");
gr.addQuery('status', 'Up');
gr.query();
while (gr.next()) {
	gs.print(gr.home_dir);
}

View solution in original post

4 REPLIES 4

Mike Patel
Tera Sage

If you want it on SN then you can go to ecc_agent.list and get home_dir field.

Run below in background script and see what you get.

var gr = new GlideRecord("ecc_agent");
gr.addQuery('status', 'Up');
gr.query();
while (gr.next()) {
	gs.print(gr.home_dir);
}

AW1
Tera Contributor
Thank you!

AW1
Tera Contributor

This worked. Thank you so much!

VaranAwesomenow
Mega Sage

Thanks @Mike Patel 
extending the solution to a non script method

VaranAwesomenow_0-1683775586609.png