Вы находитесь на странице: 1из 28

1

InstallingCactionUbuntuServer12.04

LastModified5Nov2013

McKayThompson

Howtoinstallcacti0.8.8withonUbuntu12.04
CactiInstallation
Thistutorialshowyouhowtoinstallcacti0.8.8bonUbuntu12.04server
edition.ItwillthentakeyouthroughtheinstallofthecactipluginsWeathermap,
thold,andDiscovery.Weathermapisusedtoshowagraphicalrepresentationof
yournetworkandtheamountofdatathatismovingonthenetwork.Tholdwill
actsimilartonagiosandwillnotifyyouwhensomethingisnotfunctioning
properlyonyournetwork.Discoverypingalltheipsonyournetworkand
attemptstoaccessthemwithyourSNMPstrings.
Pleasenotethatthe$isnotpartofthecommands.Somecommandstakemore
thanonelinesothe$simplyshowswherethenextcommandbegins.
GetServerupdates
$sudoaptgetupdate
$sudoaptgetupgrade
InstallCactiDependencies.Duringthisprocessitwillaskyoutocreatearoot
passwordformysql.Besuretodoit.
$sudoaptgetinstallphp5php5mysqlphp5snmp
php5gdmysqlserverapache2rrdtoolsnmpsnmpd
Downloadandextractcacti.Renamethefoldertocactiandchownthedirectory
towwwdata.
$cd/var/www
$sudowget
http://www.cacti.net/downloads/cacti0.8.8b.tar.gz
$sudotarxvzfcacti0.8.8b.tar.gz
$sudomvcacti0.8.8bcacti
$sudochownRwwwdata:wwwdatacacti

Setupmysqldatabaseandcactiuserpassword.
$cdcacti
$mysqlurootp
mysql>createdatabasecacti
mysql>GRANTALLONcacti.*TOcactiuser@localhost
IDENTIFIEDBYThisIsMyCactiPassword
mysql>flushprivileges
mysql>exit
$mysqlurootcacti<cacti.sqlp
$sudonanoinclude/config.php
Intheconfig.phpfile,changetheusernameandpasswordtothesameusername
andpasswordthatyousetupinmysql.
$database_type="mysql"
$database_default="cacti"
$database_hostname="localhost"
$database_username="cactiuser"
$database_password="ThisIsMyCactiPassword"
$database_port="3306"
$database_ssl=false
RestartApache
$sudoserviceapache2restart
Setupthecronjob
$sudocrontabuwwwdatae
Addthehighlightedlinetotheendofthecrontab
#Formoreinformationseethemanualpagesof
crontab(5)andcron(8)

#
#mhdommondowcommand
*****php5/var/www/cacti/poller.php
Fromthispointon,youwillfinishsettingupcactifromthebrowser.Pointyour
browsertoserver_ip_address/cacti

Aftergoingthroughthesetup,youwillbepromptedtologin.Thedefaultlogin
informationis
UserName:admin
Password:admin

Afterloggingin,youwillbeforcedtochangethepassword.
Nextwewillupdatethepollerinterval.Wewilldecreaseitfromthedefaultfive

minutestoonlyoneminute.Intheconfigurationsection,gotoSettingsthen
clickthePollertab.ThePollerIntervalandCronIntervalshouldbothbesetto
EveryMinute.

Congratulations!Youhavesuccessfullyinstalledcacti.

Cactisetup
Nowthatcactiisinstalled,wecanstartgettingeverythingreadyforourdata.
GraphTrees
Thefirststepshouldbetoaddgraphtrees.Ontheconsoletabinthe
Managementsectionfindgraphtreesandselectit.Therewillalreadybeone
treethatiscreatedthatisthedefaulttree,youcandeleteitandstartneworrename
it.Thetreelayoutwilldependmainlyontheorganizationalstructureofyour
district.Ifallthetechsthroughoutyourdistricthaverightstoviewallofthe
graphsinthedistrict,thenyoucancreateonemaintreeandbranchtheschools
fromthattree.Ifsomeofthetechshavepermissionstoonlyviewaspecific
school,thenyoumightwanttoconsidercreatingseveralmaintrees,oneforeach
location.Treeitemswillbesublocations,youcangoinasmanylayersas
needed.Later,wewillmakeeachhost/devicebealeaftothetree.

UserManagement
Nextyoucancreatealltherulesfortheusersthatshouldhaverightstocacti.
ThisisintheUtilitiessectionunderUserManagement.Toaddanewuser
clickAddinthetoprightcorner.Filloutalloftheusersinformationandbe
suretoenabletheaccount.Inthisexample,wearegivingausertheabilityto
onlyviewgraphs.Afterclickingthecreatebutton,wewillhavemoreoptionsas
tospecifywhichtreethisuserhasrightson.

Aftercreatingtheuser,wecanseethatthegraphpermissionstabisnow
available.Bydefault,allofthegraphswillbedisabledtotheuser.Toallowthis
usertoseeaspecifictree,youcanallowthegraphpermissionsbygraph,device,
andtemplate.Thendenythetreepermissionsandaddjustthosethatthisuser
shouldhaveaccessto.

SNMP
Beforediscussingdevices,weneedtobrieflydiscussSNMP.SNMPstandsfor
SimpleNetworkManagementProtocol.Itistheprotocolusedtoqueryyour
devices.Itcanbesettobereadonly,meaningthatitcannotmodifyanysettings
onanyswitchorserverthatyouquery.Inordertokeepyourinformationsafe,
SNMPrequiresacommunitystring(apassword)whenmakingthequery.Every
devicehasadifferentwaytoinstallSNMP.Thebestwaytosetupyourdevices
wouldbetogoogleit.AfewexamplesareCiscoSNMPconfiguration,
WindowsSNMPsetup,SNMPonUbuntuServer.Withalittlesearching,
youwillfindseveralSNMPsetupguides.Youwillwanttodocumentthese
methodsandsavethebestonesinyourfavoritesforeasyaccessinthefuture.
RememberthatnoteverydevicehasSNMPcapabilitiesandthatattimesother
methodswillbeused.

Devices
Next,underthemanagementsectionclickondevices.Goaheadandadda
device.Allyouwillneedistheipaddressofthedeviceandthecommunity
stringasdiscussedabove.Afterclickingoncreate,scrolltothetopandcreate
graphsforthishostYouwillbepresentedwithalistofgraphsthatareavailable
forthetemplatethatyouareusing.Whendoneselecting,clickcreateatthe
bottom.
Nowletsmakeourgraphvisible.Gobacktothegraphtreesandchoosethetree
whereyouwantthishosttoshowup.ClickAddontheright.Choosethe
parentitemandselecthostfromthetreeitemtype.Theselectthehost.This
willaddallofthegraphsthatyoucreatedforthathosttothespecifiedtree.
Whatsbestisthatyouwonthavetogobackandaddgraphsindividuallyifyou
decidetocreatemoregraphsforthathost.

Nowyoushouldhavetheknowledgeofhowtocreatetrees,users,anddevices
oncacti.Goaheadandaddafewdevices.
Templates
Asyouprobablynotedwhileaddingdevices,thereareonlyafewcommon
devicesthatcomestandardwithcacti.Forthisreason,cactihasalsodevelopeda
waytoaddtemplatestoyourconfiguration.Templatesarecreatedbycacti
usersandthensharedonline.Tobrowsethroughthetemplates,goto
http://docs.cacti.net/templates.

Eventhoughthatistheofficialrepository,dontstoplookingthereifyoucant
findwhatyouwant.Thecactiforumsarefulloftemplatesandscriptsthatpeople
arewillingtoshare.Googleisyourfriend.

Eachtemplateshouldcontaininstallationinstructions.Besurethatanyscripts

10

thatyouaddarechownedtothewwwdatausersothattheycanrun.Itis
theeasiestthingtoforgetandeasiestthingtofix.

TholdSetup
NowwewillsetupthecactipluginThold.Thisisthepluginthatgivesyouthe
abilitytoreceivealertsthenexttimethatanythinggoeswrongwithyour
network.Toinstalltheplugin,sshintoyourcactiserverandnavigatetothecacti
pluginsfolder.Thenyousimplydownloadandunzip.Thetholdplugin
requiresthesettingsplugintorunsowewilldownloadthatonetoo.
$cd/var/www/cacti/plugins
$sudowget
http://docs.cacti.net/_media/plugin:settingsv0.711.tg
z
$sudowget
http://docs.cacti.net/_media/plugin:tholdv0.5.0.tgz
$sudotarxvzfplugin\:tholdv0.5.0.tgzforcelocal
$sudotarxvzfplugin\:settingsv0.711.tgz
forcelocal
Makesurethatyoualsochangetheownerofthedownloadedfilestowwwdata
$sudochownRwwwdata:wwwdata*
Nowifwelogbackintocacti,weshouldbeabletogototheconfiguration
sectiontoPluginManagementTofinishtheinstallation,clickthebluearrows
underActionsYouthencanenableandstartusingThold.

YouwillimmediatelyseetwonewoptionsundertheManagementsection.

11

NotificationListandThresholds.LetsgoaheadandopenNotificationListand
takealookaround.Anotificationlistisjustalistofpeoplethatcanbenotified
whenadevicegoesdown.Beforecreatinganylistsyoushouldknowthatthere
isalreadyagloballistthatexists.Thegloballistwillholdalloftheadmins
overtheentireorganization.Inordertomodifythegloballistyoumustgoto
Configuration:Settings>Thresholds.FindEmailingOptions:DeadHost
NotificationsEmailandaddanysuperadminemailaddressesseparatedby
commas.

TheGlobalLististheDeadHostNotificationEmail
Goaheadandaddsomeuserstothegloballist.Wewillwaituntilwetalkabout
Thresholdsbeforewecreateanyothergroups.
Afteryouaredonewiththegloballist,gointodevicesandpickadevicethatyou
addedpreviously.YouwillnownoticeintheGeneralHostOptionssectionthat
thereisaTholdUp/DownEmailNotification.Thegloballististhedefault
option,youcanchangethisforanyhostthatalsoneedstonotifythelocaltechs
thatahostisdown.

Inmostcases,youwillprobablywanttoemailthegloballistbutyoustillhave
theoptionofusinganotificationlist.

Eventhoughthesearedesignedforsendingemails,theremightbeawaytoalso
getatextmessage.Goto
http://www.emailunlimited.com/stuff/sendemailtophone.htmandfindout

12

yourphonesemailaddressManyprovidorshaveawaytoemailtotext.
DeadHosts
Thedefaultdefinitionforadeadhostisafailurecountoftwoconsecutivetimes.
ThesesettingscanbechangedifyougotoConfiguration:Settings>Poller.If
youscrolltothebottomofthispageyouwillseetheHostUp/DownSetting.
Mailsetup
Nextwewillconfiguremailsettings.GotoConfiguration:Setting>Mail/DNS
andinallofyourmailsettings.Nextyouwillbeabletocheckifyourmailis
configuredcorrectly.Afteryouaredonemakingtheconfigchanges,click
Saveatthebottom.AftersavingyoushouldbeabletoSendaTestEmailat
thetopofthesamepage.Notethatifthesending/receivingemailarethesame,
yourmailprogrammaynotnotifyyouthatyougotanewmessage.
Ifyouwanttomodifytheemailsthatyougetfromcacti(Maybetooptimize
themasatextmessage)thengotoConfiguration:Settings>Thresholdsand
scrolldowntotheEmailingOptionssection.Youcanthenmodifythese
messagestoyourneeds.

CustomThresholds
Asofnow,wehaveonlytalkedaboutthehostbeingupordown.Tholdcan
alsonotifyyouifacustomthresholdhasbeenexceeded.Tocreateacustom
Threshold,gotoManagement:ThresholdsandclickAddinthetopright
corner.Youwillthenhavetospecifythehost,graph,andsource.

13

Creatingacustomthresholdisprettystraightforward.Thethresholdtypethatwe
willmostlikelyuseisHigh/LowValues.High/Lowallowsyoutospecify
warningandalertvalues.Onegoodexampleisifyouweremonitoringthe
humidityofyourserverroom.YouwouldspecifyAlertvaluesofwhentheairis
toohumidandwhentheairistoodry.Youwouldalsospecifywarningvalues
forwhenthesevaluesarebeingapproached.YouthenhaveAlertandWarning
emaillists.Unfortunately,itdoesntappearthatyoucanusethenotificationlists
(Includingthegloballist)thatwetalkedaboutearlier.Ifyouhaveseveraltechs
thatneedtobenotifiedthenyoumaywanttoconsidercreatingagooglegroup
andsendingallthenotificationsthereinsteadofusingthebuiltinnotification
lists.Intheenditmaybeeasiertomaintaininsteadofhavingtomodifyeach
thresholdindividually.

14

JustthinkoftheThresholdbeingbreachedwhenthepolledvalueclimbsabove
orfallsbelowthesetwarning/alertvalues.

Weathermapsetup
Aswithotherplugins,youllneedtodownloadthepluginandputitintoyour
pluginsdirectory.Alsomakesurethatitischownedtothewwwdatauser.
$cd/var/www/cacti/plugins
$sudowget
http://www.networkweathermap.com/files/phpweathermap
0.97c.zip
$sudoaptgetinstallunzip
$sudounzipphpweathermap0.97c.zip
$sudochownRwwwdata:wwwdataweathermap
$sudonanoweathermap/editor.php
Inordertomaketheweathermapbrowsereditoravailable,wehavetoenableit.
Changethefalsetoatrueandsavethefile.Thereasonthattheeditorisnot
activatedbydefaultisbecauseitdoesnotfallundercactisloginumbrella.This
meansthatanybodywouldbeabletogetintotheeditorwithoutloggingin.
Nextwewillfixthisbyusingapaches.htaccesstorequireausername/password
togetintotheeditor.

15

//sothatyoucan'thavetheeditoractive,andnot
knowaboutit.
$ENABLED=true
if(!$ENABLED)
{
Backonthebrowser,wewanttonavigatetotheConfiguration:plugin
Managementsection.YouwillthenseeWeathermaplistedwithabluearrow
pointingdown.Clickthebluearrowtofinishtheinstallation.Afterclickingon
thebluearrow,youwillseethattheweathermaptabiscreated.
Apache.htaccess
NowwewillfixthesecurityfortheEditor.Wewillcreatean.htaccessfileand
an.htpasswdfile.Wewillthenmakeachangetoourapacheconfigthenwell
beset.
$sudonano/var/www/cacti/plugins/weathermap/.htaccess
AuthUserFile/var/apacheAccess/.htpasswd
AuthTypeBasic
AuthName"WeathermapsEditor"
Requirevaliduser
$sudomkdir/var/apacheAccess
$sudonano/var/apacheAccess/.htpasswd
The.htpasswdfileisalistofusernamesandhashedpasswords.Each
username/passwordcombohastobeonitsownline.Anexample.htaccessfile
lookslikethis.
sam:$apr1$BTs4OvSd$deLuVBUqrlBc/AFnwxBwY0
john:$apr1$fM1SgEZG$Mwmhag6bj8YGwW6KyA44Y/

16

Tomakeyour.htaccessfile,gotogoogleandtypeinhtpasswdgenerator.The
firstfewresultsshouldallwork.Thegeneratorwillaskforyourusernameand
passwordandwhenyousubmit,itwillcreatethehtpasswdline.Allyoushould
havetodoiscopythetextandpasteitintoyour.htpasswdfile.Rememberthat
eachentryshouldbeonitsownline.

Nextchownthefilestowwwdataandmakesurethattheycanberunby
wwwdata.
$sudochownwwwdata:wwwdata
/var/apacheAccess/.htpasswd
$sudochownwwwdata:wwwdata
/var/www/cacti/plugins/weathermap/.htaccess
$sudochmod655/var/apacheAccess/.htpasswd
$sudochmod655
/var/www/cacti/plugins/weathermap/.htaccess
Tofinishup,wewillhavetomakethechangetotheapachesetup.
$sudonano/etc/apache2/sitesavailable/default
Inthe<Directory/var/www/>section,besuretochangetheAllowOverrideto
All.
<Directory/var/www/>
OptionsIndexesFollowSymLinksMultiViews
AllowOverrideAll

17

Orderallow,deny
allowfromall
</Directory>

Afterthatwecansaveandexitandrestartapache.Nowwheneverwetrytoopen
theeditor,itwillrequireapasswordbeforelettinguscontinue.
$sudoserviceapache2restart
Weathermaps
Letscreateourfirstweathermap.Inthebrowserontheweathermaptab,open
theeditorwhichisfoundinthebottomrightcorner.Wewillcreateanewmap,
wewillusethismapasatemplatefortherestofourmaps.Namethisone
template.confandclickcreate.The.confisrequired.

Aftercreatingthetemplate,theeditorwillopen.Takeamomenttolookthrough
alltheoptionsatthetopoftheeditor.Thefirstthingthatyoushouldchangeis
thesize.SelectMapPropertiesatthetop.Adjustthemapsizetobeslightly
smallerthanthesizeofyourscreen,thiswillallowustousetheentirescreento
buildourmap.Atthispoint,anyimagethatyousetasthemapbackgroundwill
resizethemaptofitthatimage.Ifyoureallywanttouseabackground,itwould
bebesttocreateacustomsizedimageanduploadittoyourserver.
Afterchangingthesizeofthemap,takealookattheotheroptionsinMap
PropertiesandinMapStyle.Youwillalsowanttoaddalegendandpossibly
repositiontheTimestamp.Whenyouaredonewithyourtemplate,click
ChangeFileinthetopleftcorner.
Nextwewillcreateanewmapbasedonourtemplate.Givethismapa
descriptivenamewithoutspacesandmakesureitendswith.conf.Assoonasit

18

opens,gotoMapPropertiesandchangethemaptitle.Thistitlecanhave
spaces.Now,starttoaddafewnodes.YoucandothisbyclickingAddNode
inthetopleftandthenclickinganywhereonyourcanvas.Dontworrytoo
muchaboutplacementbecausenodescanbemoved.Thesenodeswillrepresent
thehostsonyournetworkwhethertheybeservers,accesspoints,switches,or
anythingelse.Justthinkaboutthelayoutofyournetwork.Asyoucreatethese
nodes,besuretogivethemdescriptivelabelswhichcanbeaccessedbyclicking
onthenode.TheexamplebelowshowsmyTestSwitchnode.Laterwewill
discusscustomizingthenodes.

Afteryougetafewnodesinplace,startcreatinglinksbetweenthem.Todothis
clickAddLinkthenclickonthefirstnodeandthenthesecond.Afterthelink
iscreated,youcanclickonthelinktoopentheLinkProperties.Themaximum
bandwidthisyourpipesize.TheDataSourceisthegraphthatthislinkwill
retrieveitsdatafrom.Youwillthenbeabletofindyourswitchandselectthe
portthatyouaremonitoring.Paycloseattentiontoyourinputsandoutputs
becauseonenodesinputistheothernodesoutput.

19

Afterwecreatethelinkandaddthedata,wewontseeanythingdifferentonthe
graph.Thepercentageswillstillremain0.00%whileintheeditor.Wewillhave
togobacktocactitoactuallyseedataflowingonthenetwork.
Youshouldnowbeabletodothebasicsofaddingnodesandcreatinglinks
betweenyournodes.Goaheadandstartlayingoutyournetworkandgraphing
thedatathatisflowingacrossit.Althoughwearenotallthewaydonewith
weathermaps,wecanatthispointcreateafullyfunctionalmap.Wewillnext
talkaboutaddingsomeneatfeaturestothemapslikecustomizednodesand
mouseovergraphs.
CustomizingWeathermapNodes
Thissectionisnotrequiredbutitwillshowhowalittlebitofworkcanmakeour
graphslookalotbetter.

20

Wewillcreateashortscriptthatwillallowustodownloadanimagefromthe
internet,resizeit,makeittransparent,anddropitinourweathermapimages
folderwhiletakingcareofallthepermissionsforus.Thisscriptwilluse
imagemagicksowewillstartbyinstallingthis.
$sudoaptgetinstallimagemagick
$cd/var/www/cacti/plugins/weathermap/images
$sudomkdirscripts
$sudochownwwwdata:wwwdatascripts
$cdscripts
$sudonanogetImage
Nowwithnano,writethefollowingscript.
#!/bin/bash
DOWNLOAD="$1"
SIZE="$2"
OUTPUT="$3"
wget$DOWNLOADOtempImage

converttempImagetransparentwhiteresize$SIZE$OUTPUT

chownwwwdata:wwwdata$OUTPUT
mv$OUTPUT../
rmtempImage
Thescriptthatyoujustmadewillcopyanimagefromtheinternetandturnall
thewhitepartoftheimagetransparent.Itwillthenresizetheimageandputitin

21

theweathermapimagesfolder.Itwilltakecareofchowningthedownloaded
picturefileforyou.
Nowmakethisscriptexecutableandchangetheownerofthescript.
$sudochownwwwdata:wwwdatagetImage
$sudochmod755getImage
Ok,youreset.Torunthisscriptyoumustprovidetheurloftheimageyou
wanttodownload,thesizeyouwant,andtheoutputname.Besurethatallof
youroutputsareinthepngform.Nowyoucandoagooglesearchfortheimage
thatyouwant.Trytofindoneswithawhitebackground.
$sudo./getImage[imageURL][width]x[height][output
nameendingin.png]
Hereisanexample.
$sudo./getImagewww.example.com/image.jpg80x80
output.png
Thenexttimethatyourefreshyoureditoryouwillseethatyoucanchangethe
nodeIconFilenamethatisfoundintheNodePropertiestoyournewimage
thatyoujustcreated.Youwillalsonoticethatthelabelcoverstheimage,tofix
thisselectthenodeagainandclickedit.AddLABELOFFSETStothe
configuration.Thiswillmovethelabelbelowtheicon.

22

Goaheadanddownloadafewimagesandgoinandmakeanychangestoyour
nodesthatyouwantto.
WeathermapsMOUSEOVEReffect
Nowwewillsetupourweathermapstoshowthegraphwhenyouhoveroverthe
linkbetweenthenodes.ThefirstthingyouneedtoverifyisthattheHTML
StyleissettoOverlib.ThisisfoundintheMapStylesectionoftheeditor.By
default,itappearsthattheHTMLStyleissettoOverlibhoweveritisnotinthe
actualconfigfileyetuntilyouclicksubmit

Youcanverifythatthechangeisactuallyinyourconfigbyopeningyourconfig
andcheckingitthere.Gototheconfigsdirectoryandnanoyourconfigfileto
makesure.
$cd/var/www/cacti/plugins/weathermap/configs
$ls
Youwillthenseealistofconfigfiles.Typeinnanoandthenameofthefile.
$sudonanoexample.conf
#Automaticallygeneratedbyphpweathermapv0.97c
WIDTH900
HEIGHT725
HTMLSTYLEoverlib
TITLEDistrictOffice

IfyouseetheHTMLSTYLEoverlibinthere,thenyouareset.Afterweleave

23

theeditorandreturntocacti,wewillbeabletoseethehovereffectofthegraphs.

VIA
Viacouldbeveryusefulinthedesignofyourweathermaps.Viaallowsyouto
changethelinksfromstraightlinesintocurvedlines.Thisallowsyoutoget
aroundobjectsorevenallowsyoutocreatetwolinksbetweennodesandbeable
toseethedatafrombothnodes.ViaisfoundintheLinkPropertiesboxatthe
bottom.Again,toaccesstheLinkProperties,justclickalink.Afterselecting
via,yourmousewillturnintocrosshairsandyouwillbeabletoselectalocation
onyourgraphforthatlinktotravelthrough.

24

Youcanaddmorethanoneviapointforthelinkbyhardcodingitintothe
configuration.ClickonEditatthebottomofLinkPropertiesandontheEdit
MapObjectboxyoucanaddanotherVIApoint.Youwillprobablyhaveto
playaroundwithittogetthemintheperfectspots.Wheneveryourmouseisa
setofcrosshairs,youwillbeabletoseethecoordinatesandcanusethattomake
placementeasier.

Addinggraphstocacti.
Aftercreatingyourgraphs,youwillwanttojumpontotheweathermapstabbut
willbeonlydisappointedtoseethemessageYouHaveNoMaps.Noneedto
worryatthispoint.Gobacktotheconsoletabandgoto
Management:Weathermaps.InthetoprightcornerclickAdd.

Youwillthenbepresentedalistofallthemapsyoucreated.Goaheadandclick
Addbyeachofthem.Nowwhenyougototheweathermaptab,youwillsee
themessagethatthemaphasntbeencreatedyet.Wait5or10minutesandyour
mapwillbecreated.MakesurethatyoutryouttheMouseovereffectonthe
links.
WhenNodesrepresentNetworks.
Oftentimesyouwillrunintothecasewhereanoderepresentsanetwork.For

25

example,inyourdistrict,youwillhavethebackboneofyournetwork.Youwill
beabletoseealloftheschoolsandtheamountofdataflowingto/fromthem.
Nowwewillbrieflydiscussifyouwantedtobeabletoclickonanodeandshow
youthatschoolsnetwork.Whenyouhaveatleasttwoweathermapsformedand
addedtocacti,youwillnoticethateachmapwillhaveitsownuniqueurl.Tobe
sureyouareintherightspot,gotocactiandthenclicktheweathermaptab.
Nowwhenyouclickonagraph,youwillseethatgraphsurl.(Notethatifyou
changemapsatthispoint,theurlofthefirstmapthatyouclickedwillstayinthe
addressbar.Youwillhavetoclicktheweathermaptabtoresetthisinorderto
getanothermapsurl)

Now,copytheurlofthesubnetworksmap.Inthisexampleyouwouldcopy
theurloftheschoolsweathermap.Nowreturntotheeditorandopenthedistrict
configuration.Youcanthenclickonthenodethatrepresentsthespecificschool
andpastetheurlintheInfoURLsection.Nowyoucansaveitandreturntothe
cactiweathermapstabandtryitout.Ifeverythinggoesright,youshouldbeable
tonavigateyourmapsjustbyclickingonthenodes.

26

DiscoveryPlugin
Thelastpluginthatwewilldiscussmakesfindinghoststoaddtocactivery
simple.Inshort,thepluginwillpingalltheaddressesonyournetworkandifit
getsaresponse,itwilltrytoaccessthemwithalistofcommunitystringsthatyou
giveit.Itwilleventellyouthehostsnameandalltheinformationaboutthehost
ifitgetsapositivematchwithacommunitystring.
Installthispluginlikeyoudidtheotherplugins.
$cd/var/www/cacti/plugins
$sudowget
http://docs.cacti.net/_media/plugin:discoveryv1.51.tg
z
$sudotarxvzfplugin\:discoveryv1.51.tgz
forcelocal
$sudochownRwwwdata:wwwdatadiscovery/
Nowreturntothebrowserandgotopluginmanagementtofinishinstallingit.
Byclickingonthecirclewiththearrowinit.
Afteritisallthewayinstalled,wewillhavetoconfigureitbeforefirstuse.
GotoConfiguration:SettingsandclickontheMisctab.Filloutasmuch
informationthatyoucan.YoucanenterinmorethanoneSNMPcommunityby
separatingthemwithacolon:.Istronglysuggestmakingsurepublicand
privateareinthelistsoyouknowwhichhostshavethedefaultcommunity
stringsandneedtobechanged.AlsomakesurethatyouchangethePoller

27

Frequencyfromdisabled.Thiswillallowustorunthepollermanuallyforthe
firsttime.

Afteryouhaveasmuchasyoucanfilledoutsaveyourchangesandreturnto
yourSSHsessiontorunthepollermanually.
$cddiscovery
$sudophpfindhosts.phpdf
Thepollerwillthenproceedtopingalloftheaddressesandwilltryallthe
communitystringsthatyouhavegivenit.ItwilltrybothversionsofSNMPtoo.
Assoonasitisdone,youcanreturntothebrowserandgototheDiscoverytab.
Youshouldseethelistpopulatedwithdevicesonyournetwork.Goaheadand
addtheonesthatyouneedtomonitor.

28

Thisconcludesthistutorialoncactiandafewifitsplugins.Thebestwayto
becomefamiliarwithcactiistojumpinwithbothfeet.Eventhoughthistraining
wasntacompletetrainingoncacti,itshouldhavegivenyoutheabilityto
navigatecactiandaddplugins.Youshouldrefertoyourmaps/graphsoften,
especiallywhiletroubleshootingthingssuchasslownetworks.

Вам также может понравиться