All Apps and Add-ons

How to change parameters of up/down?

reswob4
Builder

Can you change the way this works so that if the web page returns a 403, the page is up and the light is green? and only shows red if the page doesn't return anything or if the page returns a 404 or some 500 error?

Is there something in the source code I can modify to do this?

If not, no problem, I can get this to work other ways, I just wanted to know if I could use this app....

Tags (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

Try editing this C:\Program Files\Splunk\etc\apps\website_monitoring\appserver\static\WebsiteStatusCellRenderer.js

define(function(d,b,e){var c=d("underscore");var h=d("splunkjs/mvc");var g=d("jquery");var a=d("views/shared/results_table/renderers/BaseCellRenderer");var f=a.extend({canRender:function(i){return(g.inArray(i.field,["title","response_code","response_time","average"])>=0)},render:function(m,i){m.addClass(i.field);var j="";if(i.field=="response_code"){var l=parseInt(i.value,10);if(l>=400){m.addClass("failure");j="alert"}else{if(l>=100){m.addClass("success");j="circle-filled"}else{m.addClass("failure");j="alert"}}}else{if(i.field=="response_time"||i.field=="average"){var k=parseFloat(i.value,10);if(k>=1000){m.addClass("failure")}else{m.addClass("success")}}}if(j!=null){m.html(c.template('<i class="icon-<%- icon %>"> </i><%- value %>',{value:i.value,icon:j}))}else{m.html(i.value)}}});return f});

to be:

define(function(d,b,e){var c=d("underscore");var h=d("splunkjs/mvc");var g=d("jquery");var a=d("views/shared/results_table/renderers/BaseCellRenderer");var f=a.extend({canRender:function(i){return(g.inArray(i.field,["title","response_code","response_time","average"])>=0)},render:function(m,i){m.addClass(i.field);var j="";if(i.field=="response_code"){var l=parseInt(i.value,10);if(l!=403){m.addClass("failure");j="alert"}else{if(l=403){m.addClass("success");j="circle-filled"}else{m.addClass("failure");j="alert"}}}else{if(i.field=="response_time"||i.field=="average"){var k=parseFloat(i.value,10);if(k>=1000){m.addClass("failure")}else{m.addClass("success")}}}if(j!=null){m.html(c.template('<i class="icon-<%- icon %>"> </i><%- value %>',{value:i.value,icon:j}))}else{m.html(i.value)}}});return f});
0 Karma

reswob4
Builder

I tried this and it doesn't appear to work.

BUT: I need to do some troubleshooting. The result now is Connection Failed which indicates it is timing out. and then some other things (unrelated) started happening which has currently forced me to uninstall this app (when it rains it pours).

So I'm going to have to focus on those things and stop working on this. thanks for your help. When I get back to this I'll start a new thread.

Thanks again.

0 Karma

jkat54
SplunkTrust
SplunkTrust

dont start a new thread, this should have worked, it would require a splunk restart and possible clearing browser cache by pressing ctrl+f5 at same time... but if you start a new thread this one will go unanswered and it fubar's our statistics.

0 Karma

reswob4
Builder

OK, will continue this thread then.

Thanks again.

0 Karma

jkat54
SplunkTrust
SplunkTrust

Which dashboard or panel or saved search are you speaking of?

0 Karma

reswob4
Builder

Website Monitoring

https://splunkbase.splunk.com/app/1493/#/overview

In the config, all you do is enter the url to monitor. On the surface, there doesn't seem to be a place to change the parameters of what you can consider up or down.

And yes, defining a 403 as up may seem odd, but..... In this case, I'm just the tech grunt.

0 Karma

jkat54
SplunkTrust
SplunkTrust

Oh OK... but which dashboard, panel, saved search, or report in the Website Monitoring app do you want to have a green light for 403s?

0 Karma

jkat54
SplunkTrust
SplunkTrust

Maybe you can create a screenshot and circle what you want to be green instead of red. Just make sure the screenshot helps someone identify what dashboard you're on.

0 Karma

reswob4
Builder

So I'm going to steal the example jpg from their wiki:

alt text

Notice how it shows 200 as green. I'd like it to not show the number, but only show GREEN if I get a 403 back.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...