Custom script for Ironport

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
sridharp
Posts: 3
Joined: Wed Nov 23, 2011 4:24 pm

Custom script for Ironport

Post by sridharp »

Hey All,

I'm new to cacti and scripting.. and working on new requirement for ironport monitoring .. Here is the requirements...

1. Get X1 using Snmpget (cpucachetime)
2. wait for n seconds
3. Get X2 using Snmpget (cpucachetime) -- the OID is same as step 1....
4. printout of value of (X2-X1) / n *100 - This value would be actual performance in percentage.

I'm not sure how to implement this in Cacti. Any suggestions would be very helpful.

Thank you
Sridhar
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Custom script for Ironport

Post by noname »

Probably no script is needed in this case.

Try:
1) Create new CDEF (e.g. "Multiply by 100")

Code: Select all

cdef=CURRENT_DATA_SOURCE,100,*
2) Duplicate "SNMP - Generic OID Template" (or "Cisco Router - 5 Minute CPU") data template, then configure it
- Choose "GAUGE" as Data Source Type
- Set your OID

3) Create new graph template (or duplicate "Cisco - CPU Usage")
- Choose the above datasource (= step 2) for each graph items
- Select the above CDEF (= step 1) as CDEF Function

4) Add the above graph template to your device, then create graph

See also:
- Walkthrough: My First Data Template
- Walkthrough: My First Graph Template
sridharp
Posts: 3
Joined: Wed Nov 23, 2011 4:24 pm

Re: Custom script for Ironport

Post by sridharp »

Hi,

thank you. However, in CDEF how do i get the value of the old data source. In my case, the goal is to find the difference between current data source and another datasource 5 mins before.

I checked special data source and I'm not sure how to get value of old datasource..

I tried this CDEF:

CURRENT_DATA_SOURCE,PREV,-,300,/,100,*

As my polling interval is 5 mins... i thought might work..any suggestions would be helpful.

-Sridhar
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Custom script for Ironport

Post by noname »

sridharp wrote: thank you. However, in CDEF how do i get the value of the old data source. In my case, the goal is to find the difference between current data source and another datasource 5 mins before.
Oops, then try "COUNTER" (for cumulative value) or "DERIVE" (for up/down counter, see RRDtool manual) as data source type at the above step 2).
Calculating differences from previous data will be done by Cacti (RRDtool).
sridharp
Posts: 3
Joined: Wed Nov 23, 2011 4:24 pm

Re: Custom script for Ironport

Post by sridharp »

Thanks a lot. That helped....

I set COUNTER in Data template used CDEF to get it in percentage....

-Sridhar
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests