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

Niklas Peterson
Mega Sage
Mega Sage

Hi,

Check the dictionary for the "Monitored CI type" field. In my instance the attribute base_table is set

to base_table=cmdb_ci

 

NiklasPeterson_0-1713937458711.png

 

This will restrict the field to only include CMDB tables. You may have something else.

 

Regards,
Niklas

Thanks for your suggestion. 

 

It is configured the same for me. Since the view sn_itmon_http_entrypoints is listed I guess it must be a setting on the database view. Or there is something else that has to be configured to make a view or table available in the Monitored CI type list. 

 

I had also tried to use the Monitored CI Script with the following query instead:

    var monitoredCis = new GlideRecord('sn_itmon_http_entrypoint');
    monitoredCis.addQuery('ip_address', '!=', '');
    answer = monitoredCis;
but it fails on publishing
 
 

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

Hello again,

The database view is added to the list of tables by a client script called addDBView. You may be able to modify that to add your own database view.

 

 

NiklasPeterson_1-1713988957622.png

 

Regards,
Niklas