Embedding nfsen graphs in other pages

Pre Reading:

Once you have nfsen running and capturing data you might want to embed the graphs into other pages for reporting purposes. In my case I need a created a simplified webpage which showed my manager a basic graph he could understand.

To do this you will need to go to Nfsen and setup the graph so that it shows what you want.

nfsen

Then right click on the graph and select “Copy image location”. If you embed this URL into a webpage you will find that its static and the image will not change.

The URL has the following format:

http://tools/nfsen/rrdgraph.php?cmd=get-detailsgraph&profile=./AtlassianServices&arg=wiki%3Ae-wiki-or-e-support%3Ajira+any+traffic+1440338400+1440570300+1440656700+1440656700+1440656700+576+200+0+0+0

The four large numbers have the following meaning:

  • 1440338400 – Start (of the profile)
  • 1440570300 – Start of the graph
  • 1440656700 – End of the graph
  • 1440656700 – Tstart (start of the time range selection)
  • 1440656700 – Tend (end of the time range selection)
  • +576+200+0+0+0 – Graph size parameters

You can then replace the second number with “end-1d” and third numbers with “now”. This basically means – draw a graph from now till 24hours ago.

http://tools/nfsen/rrdgraph.php?cmd=get-detailsgraph&profile=./AtlassianServices&arg=wiki%3Ae-wiki-or-e-support%3Ajira+any+traffic+1440338400+end-1d+now+1440656700+1440656700+576+200+0+0+0

The new URL can be embedded into a web page and it will display the latest information from the database.

Although I haven’t tried any other options I suspect the parameters will be the same as supported by rrdtool. Try the others and leave me a comment.

Update 15/9/15 :This method only seems to work on the original machine which has a session to NFsen. Peter mentions other methods to extract them but I cannot find and references: http://sourceforge.net/p/nfsen/mailman/message/20697518/ and http://sourceforge.net/p/nfsen/mailman/message/22940378/

Update 18/9/15: You can embed any of the graphs which are shown in in the Graphs tab in NFsen. These graphs are dynamic but you limited to the day, week, month & year graphs.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s