Need a database view to be used in ACC policies as CI Type

tschneider
Tera Expert

Hi,

 

I've duplicateed the database view [sn_itmon_http_entrypoint] to a new one which includes all tcp entrypoints and not just the http(s) ones. I would like to use that view to filter CIs in an ACC policy.  The database view configuration is identical to the original one, just that it uses the tcp tables instead of the http ones:

tschneider_0-1713350539276.png

 

But I'm not able to use this in the ACC policy to select CIs. Only the original view is listed:

tschneider_1-1713350613871.png

 

I guess, I'm missing something? 

 

Thanks for your help

Thorsten

 

1 ACCEPTED SOLUTION

Hi.

That script failed on publishing for me as well. But this one seemed to get published.

 (function getMonitoredCiType(){
 var monitoredCis = new GlideRecord('sn_itmon_http_entrypoint');
    monitoredCis.addQuery('ip_address', '!=', '');
	monitoredCis.query();
	return monitoredCis;
  
 })();

Not sure it works though, that query should return dbview records and I assume you would like the CI records from those dbview records?

 

Regards,
Niklas

View solution in original post

6 REPLIES 6

Hi Niklas,

 

wow, that is a great find! I tried to modify the policy and added my view into the script, but the entry in the table field is missing. And I can't pick the sn_agent_policy table from the list. Weird.

 

tschneider_0-1714036430539.png

 

For now I stick to the other option

 

Thanks again for your help!

Hi,

 

yes, that works like a treat. As mentioned in the description I ommitted the call to monitoredCis.query() and just added the return command.

And I had to change the addQuery statement as the field names get prefixed in dbviews.

 

Thanks a lot for your help