in this video I'm gonna show you how I
created this hello everyone this is
Ciraltos and I'm Travis this video is a
little different from other videos that
i've done it contains information I've
already covered it also adds some new
stuff including application insight cost
management and a little on Raspberry Pi
at the end I don't intend to go very
deep into any of those subjects that
I've already covered I'm just gonna
reference them as I move along before
that please take a second to subscribe
and click the bell icon if you want a
notification when I publish new content
in this video I'm gonna pick up where my
last Grafana video left off with
performance data from my test lab after
that I'm gonna set up a connection
to application insights so I can pull
data and statistics from my blog to
display on the dashboard I'm gonna build
an Azure automation run book that
will upload Azure consumptions or
spend data into log analytics I'll use
that to track my Azure subscription
spend over the month once that's done
I'll configure Grafana for anonymous
kiosk mode and use a Raspberry Pi to
display the data I also have some hints
on mounting hardware if you plan to
follow along you're gonna need a few
things first a Grafana server see my
other videos on setting that up note
that the new version of Grafana has
the Azure monitored data source
plug-in pre-installed so you don't have
to add that manually as I demonstrate
in one of my videos this is a good
sign of the commitment between Azure and
Grafana
you'll need an azure subscription and
log analytics workspace again see my
other videos if you need help with that
I'm going to display data from
application insights
I used the WordPress plug-in to push
data from my blog and always sound like
a broken record saying it but I
published a whole video on how to set
that up if you're interested in doing
the same next I'm going to use an Azure
automation runbook to gather
subscription cost information a link to
the code on my github page will be
available below or on my blog I'm
powering the display with raspberry pi
using full-page OS there's a lot of
resources on how to set up raspberry
PI's I'm not going to go into much
detail on that I'll show you how I can
you're full-page OS to display the
dashboard and as a side note on that I
originally tried to use a Raspberry Pi zero
that does not have enough power to
display the dashboard it just kind of
sits for 20 minutes and then times out I
ended up using a Raspberry Pi 3 plus for
this demo I also have some mounting
hardware and power cables for the
install so with that let's get started
with the first step I'm gonna pick up
here where I left off on my last Grafana video this is my dashboard that we
created and the previous one as you can
see here I percent processor time %
commit bytes in use I've got a list of
all the servers that I have monitored as
well as servers that are missing
heartbeats within the past 15 minutes so
this is gonna be the base it's going to
cover the monitoring of my test lab and
then I'm just gonna add on from here so
as I said I'm just picking up where I
left off on the last video I will say
that I did install a new server and
install gharana new and with the new
installations as I probably mentioned
already the is your monitor data source
comes standard with the new Grafana
install so you don't have to install
that separately as I did in my previous
video so the first thing I'm gonna do
though I do like the information here
but I don't like how processor time and
commit bites and use displays it's got
this huge gap my test lab is pretty low
use most of the time so I'd like to see
a little bit more activity even if it is
down to you know under 10% but the
reason why I did this originally is I
wanted to see if the server spiking at
any time above the 80 or 70 percent
range so what I'm gonna do is I'm gonna
edit this and I'll go into visualization
and I'm gonna scroll down well actually
I'm going to first go here and remove
the zero and the 100 and you can see as
soon as I do that I get a little bit
more detail although it's still pretty
low it doesn't give me detail which I
guess looks a little bit more impressive
aesthetics is a important thing in this
as well so I'm going to add a threshold
so the first threshold is going to be
greater than 50% and that's going to
trigger a warning
and then I'm gonna add another threshold
and I'm gonna set that to 75% and that's
gonna go critical now once I do this
what its gonna do is if my CPU gets
above 50%
it's gonna go into an orange or warning
state and I'll be able to see that just
at a glance looking at my dashboard if
it goes above 75% then it's gonna go
into a red here I'll show you I've got a
screen shot that I took earlier when
this happened okay so I'm gonna do that
that's good and I'm gonna go back and
I'll just save that real quick I like to
save it for each change and then I'm
gonna go into committed bytes and use
and edit and we're gonna do a similar
thing here so I'm gonna scroll down and
add a threshold and we'll say 75 percent
I'm gonna go to warning and then another
one if it's greater than 85 percent and
you can obviously pick whatever you want
I'm gonna go to critical then we'll go
back oh you know what I forgot to do I
forgot to change the legend details here
where is that the min max value so I got
to delete these once I do that you can
see now it's just showing more data so
this looks better now I get more detail
in my graphics and I'll also be alerted
if something goes above those define
thresholds gonna save again all right
now that that's in place I'm going to
add a couple more visualizations here so
the first thing I'm gonna do is go into
my data sources and I'm going to pick
application insights oh but you know
what I forgot to do I need to go back
and talk about application insights a
little bit so I added the application
insights plug-in to my blog and that's
feeding data into my application
workspace or application insights
workspace so what I need to do is set up
the data source to pull data from
Application Insights now if you're interested in
doing this I have a video that shows how
to add the application insights plug-in
to WordPress you go back and watch that
but for now I'm just gonna go to let's
see let's save that and I know I can go
into data sources there we go so an
application insights I need to add an
API key and I need to add an application
ID okay so there we go now we've got the
API key and the application ID added and
that's going to give us access into
application insights so let's go back to
my dashboard not new dashboard there we
go I'm gonna modify this one so I've got
application insights I'm gonna change
this to user count there it is we'll go
to a specific time gain okay so one
thing I want to point out is now
application insights I don't have to
enter in a query like I did with log
analytics all of these are already
defined one thing to know because I'm
using the WordPress plug-in I can't get
access to the underlying OS settings or
information like performance count or a
CPU percent or memory that stuff isn't
exposed to the level that I'm tracking
information at the WordPress plug-in so
I can get site-specific data but this is
a shared plan so I can't get access to
the CPU memory disk  IOPS that kind of
stuff if you're using IIS that you
install it yourself or if you're using
app service you can get access to that
information but here I just can't so I'm
going to do user count then I'm gonna go
into virtualization one thing I'm gonna
do is change this to blue everything
that's WordPress related is going to be
blue or have some indication by blue so
I'm gonna leave that as blue and I'm
gonna come down and actually I'm just
gonna leave it like this
so now I'll go into general and I do
want to have a title for this and when I
put this into production I'm going to
change this all to transparent but
for now I'm gonna leave it not
transparent because I want to see where
I position all this stuff
I'm gonna save again so I'm gonna add
another and this one's gonna be failed
requests so I'm gonna come back up here
make sure that set to application
insights and we'll then we'll go into
failed requests if I can find it
I guess that's request failed there we
go
and again I'll change this to blue there
we go
I'm gonna do something a little
different to this one I'm gonna come
down I'm gonna set the same types of
thresholds let's see if it's greater
than 20 failed requests I'm gonna go to
critical and then if it's greater than
15 failed requests will go to warning
and if it's greater than actually less
than 15 we'll say okay I don't know that
I agree with those numbers totally but
it works for me for now and then I'll
come down here and give it a name and
I'm just gonna move this one down here
I'm going to add another one I'm going
to call this one request count so we'll
go to application insights again and
request count
we'll go into visualization and I'm
gonna change this from a graph to a
heatmap I will be the first to admit I
may not be using the heap map in the
actual proper way but I do like the
visualization and it does tell me the
information I need so I'm just gonna run
with it show legend there we go so this
gives me an idea of how many requests
are coming in and that's different than
user count users can have multiple
requests and I'll come down here to
panel title give it a name
okay so good we're making progress here
we're getting some really useful
information out of this
the next thing I'm gonna do is I want to
measure availability I'm gonna add
another this time I'm going to do a
single stat let's go back up to the
queries we're gonna select application
insight again and availability results
availability percentage see if I can
find that in here there we go
so aggregation is average group by none
this all looks good now it's just
showing a hundred there and I'm gonna
change that so I actually want to gauge
I'm gonna change the unit to percent I'm
gonna make the threshold 90 and I'm
gonna make this a gauge there we go
that's almost okay but let's invert that
there we go and let's go to threshold
labels there we go so now what it's
gonna do is is gonna measure my
availability and that's coming from an
availability test that application
insights is running if my percent goes
below ninety this will turn red the 90
or whatever percentage it is it will
turn red and that big green bar the
thick stuff here will also turn red here
actually I can show you a picture of it
because I had a minor outage during a
server upgrade recently and I
took a screenshot of it so I'll show
that now here you can see how it changes
when my availability drops below 90% the
only thing left to do is change the
title I'll just make that a little bit
smaller okay so the next thing I need to
do is I need to add another gauge that
shows my spend and for that I'm gonna
hop over to Azure automation okay so
this is gonna take a little explaining
if you're not familiar with log
analytics please jump back I have a
whole bunch of videos on it you don't
have to go too deep to understand what
I'm doing but I'll go over it briefly I
want to keep track of how much I spend
on Azure every day or every month
there are some commands that I can run
here I can scroll down and show them
that actually pull consumption data from
billing so it's get-AZconsumptiondetails and we have that
right here and then get let's see here
get-AZconsumptionbudget so within
Azure cost management you can set a
budget and in my case it's a hundred
dollars so but if I ever change that I
don't want to have to go in and
hard-code dashboards and make those
changes
this is gonna get my budget amount it's
also gonna do get the consumption
details which is a daily spend record
within that billing period and all I'm
doing here is I'm getting that that
budget amount and then I'm getting the
day I'm going to get some usage details
with that AZ consumption usage detail
and then let's see I'm gonna take and
sum that into one lump sum so I know
how much month to date that I'm spending
and then I'm going to build a hash table
with all that information and pass that
into log analytics so in order to pass
it into log analytics I have a function
that I wrote that will take anything in
hash table and pass it into log analytics so that's what I'm using that's
what all this up here is it's I've got
it pretty well-documented I think even
did a video or something that goes over
how I how I did it you're free to use it
I'll make this available check the link
below
I'm sure or my blog post that accompanies 
 this and you'll be able to get
information but so what this basically
does is it just grabs the billing
consumption details and then it passes
that into log analytics so then from log
analytics I can query that and pull
information into my dashboard so this is
and is your automation run book and I
can just tell it to run every day at
midnight and it's gonna update the
information and log analytics let's go
over to log analytics and take a look at
that information here's my spend so if I
run that this is gonna show for the last
24 hours I changed that time range to
say 7 days here's what it looks like so
we can see my budget I've got a billing
period the billing period is the year
and month that the bill will be due so
you can see I have all of these for May
20 19 and then I have one popping in
here for June 2019 so I'm just gonna
pull all this data into log analytics
and then build a gauge off from that so
with that let's build that gauge and
again if I didn't go over this well
enough everything that I'm doing I have
another video that goes into it way more
detail if it's something you're
interested in doing you can either just
grab my my script and set up a run book
or you can go back in those videos and
they go over what I'm doing pretty
thoroughly so I'm gonna create a new
visualization and again that's going to
be a single stat let's go up here I'm
going to change this to log analytics
I'll drop in the query and again this
will all be available and then let's
just run that Oh
got this has to be set to a table okay
so that's the billing period we can fix
that for a column we're gonna change it
from period to period spend there we go
eight dollars and I'm gonna just shrink
the font size on this a little bit we'll
call that spend and we're gonna change
that unit to dollars and we're gonna
change this to show the gauge and we
also want the threshold labels on okay
so we're getting close I'm gonna change
it to threshold to sixty and eighty so
what this means is as I get closer to if
I get above sixty percent and being that
it's a hundred dollars it's just above
sixty dollars it'll go into orange and
then if I go above eighty it's gonna go
into red let's change the value here
there we go now the value will change
color as my amount of spen goes up this
is an important one for me because all
of this Azure spend is out-of-pocket
I'm not getting reimbursed for it so I
want to make sure that I don't leave a
very expensive VM running or set up
too many managed disks that start
costing me money this will help me see
that information just at a glance the
only thing left to do is change the
panel title I'll just drop that in there
okay so I'm getting close I do want to
modify this a bit first the gauge does
not have to be as big as it is so I can
shrink this down I can actually take
this and put it right next to that one
and you know what I actually want it
over here so now what I'm going to do is
just make a little adjustments make it
fit on the screen better I can make this
a little smaller and actually that's
server information so I'm going to put
that down here so I want request count
up top and I want user count again I'm
sticking with that blue theme for
anything website related I'm gonna make
this failed request a little bit smaller
interesting note about failed request
I'm giving a lot of 404s for Apple touch
icons it's actually looking better
because I added a whole bunch of icons
in to my site but I'm still missing a
couple that's a topic for a different
day though gonna make this a little
smaller I actually want this over here
oh this is the neat thing about Grafana
is you can just kind of drag and drop
and hopefully you can see on the screen
all of these windows have a shaded gray
background I'm gonna actually change
that once I get this all laid out the
way I want it
okay that looks pretty good now I'm
gonna make these all transparent just go
into edit go to general and check the
transparent box oh oh oh look at that it
must have been failed a query at one
point okay so I'm just gonna go in here
and go to edit and I'll spare you with
the rest and just do it okay that's done
the backgrounds are all transparent now
I just think that looks a little bit
better up here make sure you have this
set to show the whatever amount of hours
you want 12 right normally stick with 6
make sure you're refreshing every 10
seconds or at least frequently enough to
show information you want to see
once that's done one final save and now
we're gonna start configuring some of
the kiosk modes and anonymous access ok
everyone we have the dashboard set up
the way we want it you can make changes
as you see fit but for this I'm going to
continue on now one of the things I'm
going to do is come into home and I'm
going to star this dashboard Ciraltos and then I'm going to go into
preferences and the first thing I'm
going to do is change the organization
name to Ciraltos the organization name
will be needed in a future step so I'm
just gonna click Save to save that the
UI theme is we can leave that to default
you can select darker light if you'd
like to the Home Dashboard it's set to
default I'm gonna set this to Ciraltos
now if you don't see CIraltos in the
list you have to go back just a couple
of seconds ago I went in to let's see
here let's just go back I started this
you have to start that let's go back
into preferences we'll set
and time zone I'm gonna use local
browser you can set it to default or
save it as UTC if you'd like okay so
what this is gonna do it gives me an
organization name it's also gonna set
the home dashboard
so if I go in and do a incognito window
and I figure out what IP address that
was there it is okay it's gonna take me
straight to my dashboard which is
exactly what I want you can see it's
going to do six hours and or show the
last six hours and refresh every 10
seconds I'm just gonna copy this I don't
have to type it in again cuz I will be
coming back into here okay so when I
login I'm going straight to my dashboard
as before I was coming into I think it
was no those fingers of the manage
anyway I'm going into the dashboard now
so I'll go home okay now I'm gonna make
another change I'm going to cycle my
view you can see we have different view
modes so I'm gonna go to kiosk mode so
in order to view in kiosk mode we
actually have to have that kiosk right
here so let's try that perfect okay so
we also need to save that link that's
going to be very important coming up I'm
just gonna pop it into another spot here
okay so now we've got the dashboard the
way we want it to display now the next
step is to enable anonymous
authentication in order to do that
you're gonna have to login to the
Griffons server all right here I am
logged in to the Griffons server
I'm using Putty you can use whatever
else you want to use or if you have
console access you can do it that way so
let's see here see where we're at
I'm going to change directories to etc
and within there there's going to be a
directory called Grafana and in that
directory is grafana.ini now I'm
gonna edit this file so how I'm gonna
edit that is do sudo that will give me
elevated rights so I can modify this
file and I'm gonna use VI and grafana.ini if you have a preference on text
editors you like to use with Linux and
go ahead and I'm having a hard time
seeing this but I have to go down to an
anonymous authentication section let's
see here
anonymous authentication okay so there's
two lines that I found I need to enable
and I'm actually going to comment out
this but first I'm going to do yy
to copy it and then a P to paste I'll go
back and edit that later and I need the
org name so I'll do YY and then P now
if you're not familiar with using VI or
vi is what I normally call it I'll call
out the steps that I'm taking
so now that I've copied those lines I'm
just going to do an i for insert
that's going to put me in edit mode
we're going to comment out that I think
that semicolon was a comment but just to
be sure
and now I'm just moving my arrows and
entering so I'm going to remove the
comment from that line and change this
to true
and remember when I said we would need
that organization name later here we go
I guess you could have left it default I
did not now one thing to keep in mind
once I enable anonymous mode I'm not
going to be able to log in and modify
this dashboard so that's why I wanted to
make sure everything was set the way I
wanted it from the beginning if you need
to edit it simply come back in here put
a comment the pound sign in front of
enable and org name and then restart the
service that's all you need to do and
then you modify your dashboard and then
when you're done come back and uncomment those lines save it and restart
the service so now that I'm done editing
this file I'm going to hit escape that
takes me out of insert mode the colon
will put me into command line this is
where I can do activities now if you
just screwed this up and you're panicked
don't worry just go Q and exclamation
point and hit enter that will take you
out of edit mode without saving any
changes so what it's saying is quit
without saving or just quit but I do not
want to do that I want to do Q and W W
means quit and right so that's going to
update the file actually it's write quit
it would make sense to write before you
quit so there we go
now I'm going to restart the service
we're going to do that with sudo service
grafana-server restart all
this is available on the Grafana website
as far as how to change this also if you
do a search for VI commands you can come
up with all this pretty quickly so now
remember when I said we had to save that
URL I'm gonna come in and open up a new
incognito window and paste that URL in
cross my fingers BAM
so let me explain what what I just did
so we modified this dashboard exactly
how we wanted it and then we went into
Grafana and we told it to allow
anonymous read-only access and then with
that link that says put it in kiosk mode
we were able to log in without any
authentication this is important because
in the next step I'm gonna use raspberry
pi with full-page OS full-page OS has no
ability to log into a website it just
pulls up and displays one web page so
I'm gonna use the URL that we saved in
the settings to tell it to open up the
script on a web page so while we're at
it let's just start talking about full
page os full page OS is a raspberry pi
OS that's built to do two things connect
to a wireless access point and display a
web page this is what I'm gonna use to
power the display I'm using a Raspberry
Pi 3 plus I did try a raspberry pi zero
and it does not have enough power to
display the graphs it's sat for about 20
minutes and then eventually timed out
and it just didn't work so save yourself
a lot of frustration and waiting and
just get a Raspberry Pi 3 if you plan on
doing this I'm not gonna go over how to
install full-page OS there's a lot of
documentation on how to install OS's on
Raspberry Pi it wouldn't make a lot of
sense for me to go over that but once
you get Raspberry Pi installed we need
to log in now there's two ways to
configure the full-page OS on Raspberry
Pi I'm going to SSH into it you could
put in the micro SD card and scroll to
the two files and open them up in
Windows but do not open them up with the
text editor here let me show you
I'll start by coming down into
requirements there's two files you'll
need to modify fullpage-OS-WPA-subclient so let's take a look at that here
I'm logged in and we're just going to
take a look at that now I'm not doing
this with elevated privileges because
this is already configured but the one
thing that I want to point out that I
started saying before heads up
those users do not use WordPad for
editing this file okay so what it's
telling you is use either notepad plus
plus vs code Adam sublime text proper
text editor so just follow those
directions you could like I said you
could open this file in notepad plus
plus on Windows and do what I'm doing
here within this file the full page OS -
WPA - sub client I'm just gonna go down
there's two settings one is the SSID and
if you scroll down it's gonna ask for a
password I am NOT going to scroll down
because I don't want to expose that so I
think you'll get the point though that's
where your SSID goes as well as the
password the next one I'm going to edit
and this time I am gonna do sudo to
actually edit it full-page OS oh I
forgot to type that in okay so this is
the it's the URL for the kiosk mode for
our dashboard so you can enter this like
we did before where you hit I for insert
and then type or paste it in and then
when you're done hit escape : and either
WQ to update it or just queue thing to
exit so that's all there is to it once
you have that in place reboot the
Raspberry Pi and it should pull up the
dashboard in kiosk mode as it boots next
I have to mount the monitor and the
Raspberry Pi so I just marked the
location where I wanted it to be on the
wall and started drilling holes I'm not
going to go too deep into that because I
assume you probably know how to do that
here are the cables that I used I found
a power cable that has two female ends
one end goes into the monitor the other
end is a normal plug that I can plug the
Raspberry Pi into
ideally I would have had a monitor with
a USB port that I could just plug in the
Raspberry Pi to that for power and then
I have a short HDMI to DVI connector I'm
using an older salvaged monitor for this
project that doesn't have HDMI port
here I'm putting on the mounting
hardware and also running the cables up
I was originally gonna put the Raspberry
Pi on top but actually opted to hang it
off underneath and to the side lastly
this is it booting up power on to the
dashboard displaying only took about a
minute but I'm gonna fast forward this
just to get through it a little quicker
and there you can see Grafana is loading
and the dashboard is displaying thanks
everyone for watching I hope you found
this useful and informative don't forget
to subscribe and click the bell icon if
you want to get notifications for new
content thanks again
