This post assumes you have fairly adequate knowledge of MediaWiki administration and basic knowledge on how templates in MediaWiki work.
So you have a wiki powered by MediaWiki and you also happen to have an Observium installation in your network.
You want to display CDP map of a particular device in your network, in the corresponding device's page in your wiki. (Or any other wiki page for that matter). You only want to tell your wiki Observium's device ID, and in return wiki is to produce CDP map based off of data Observium collects on your network.
For instance, I place the following template inside a wiki page, and pass any an ID of a Cisco device Obserivum has been keeping track of.
{{DeviceMap|34}}
In this case 34 is the device ID of a Cisco device in my Observium installation. The output of above is as follows.
Now the beauty of this is, you don't really have to come back to your wiki page to change the documentation every time you change something in your network. Your Observium already keeps track of it, and it gets reflected in your wiki within 5 minutes of the change.
Colored interfaces are clickable links which takes you to respective graph page in Observium. Colorless interfaces and devices are what CDP "sees", but are not monitored by your Observium.
How do you set this up in your local wiki?
I will post the the templates I created at the end of this post.For those templates to work, you will need to have the following prerequisites met in your wiki and Observium installation.
MediaWiki checklist:
- GraphViz installed on the server running MediaWiki. I have version 2.38.0 in my installation. Your GraphViz MW extension is practically useless without the GraphViz binaries.
- MediaWiki Parser Functions - My PaserFunctions version is 1.6.0 (This used to be an extension, but is now bundled starting from MW1.18)
- ImageMap extension - (I have a git commit of this from August 2014. Doesn't really show me a version number on my Special:Version page)
- Enable this in your wiki
- GraphViz extension - (READ THIS: You can go ahead and install the latest version of this Extension. I don't use the latest version because it has the nasty habit of uploading the graphviz output to MW each time your ouput changes. This may not be a bad thing if you are using MW to render CDP maps and such, that hardly change. In my Installation I use MW Graphviz extension in conjunction with Observium to actually produce real time Weathermaps within my Wiki. And you know weathermaps change every 5 minutes. That's a lot of uploads if you refresh your weathermaps a lot) -- The version I use is here. You can configure this like like you configure any other extension.
- External Data extension - My version of this extension is 1.8 - Have this installed and configure it so that it can talk to your Observium database. This is configured in LocalSettings.php. Mine looks like below:
If you don't want to modify my templates, you may want to use below. Else you can use your own instead of "observerdb" and modify my templates accordingly.
- // Defining for ExternalData extension
- $edgDBServer['observerdb'] = "OBSERVIUM_DB_IP";
- $edgDBServerType['observerdb'] = "mysql";
- $edgDBName['observerdb'] = "observium";
- $edgDBUser['observerdb'] = "SQL_READ_USER";
- $edgDBPass['observerdb'] = "SQL_PASS
";
Observium checklist:
The templates:
- Template:Device map links
- Template talk:Device map links
- Template:ObserverGraphMemory
- Template:ObserverGraphDeviceTotal
- Template:ObserverGraphCPU
- Template:DeviceOverview

No comments:
Post a Comment