Prerequisite
- Enable SNMP monitoring in WSO2 ESB using
https://docs.wso2.com/display/ESB490/SNMP+Monitoring
Installing Cacti
Creating new device
Important : If this value is smaller than data stat value, those data points will not be added to records. You can look at Cacti Log to estimate the maximum value which should be set.
Installing SNMP package
- Install SNMP and SNMPD packages using following commands
sudo apt-get update
sudo apt-get install snmp snmpd
|
Installing Cacti
- Install required dependencies for Cacti
sudo apt-get install mysql-server apache2 libapache2-mod-php5 php5-mysql php5-cli php5-snmp
|
- Installing Cacti
apt-get install cacti
|
- While installing Cacti provide following commands
configuring libphp-adodb
-> press ok
configuring cacti
configure database for cacti with dbconfig-common
-> press yes
password of your database's administrative user
-> mysql root password (empty by default, fill accordingly)
mysql application password for cacti
-> give the password you would like cacti to connect to mysql with
webserver type
-> Apache2
|
- Got to http://<Cacti-installed-host>/cacti URL
- Click next button in the ‘Cacti Installation Guide’ window.
- Select ‘New Installation’ from the list in next windows and click next button.
- Make sure every field is marked ‘FOUND’
- You will be directed into user login window. Use ‘admin’ username and ‘admin’ password for first login.
- Enter new password and confirm that password in the next window.
- Following page will be loaded if you have successfully installed Cacti
Creating new device
- Click on ‘console’ tab.
- Click ‘Add’ button in Devices page
4. Fill following fields and click create button to create the device
- General Host Options
- Description - Device name
- Hostname - Hostname of the SNMP client device
- Host Template - Select ‘Generic SNMP-enabled Host’ as the host template
- SNMP Options
- SNMP version - Select ‘Version 1’ for the SNMP version
- SNMP Community - Provide SNMP community name : default community name is ‘public’
- SNMP Port - Provide the ESB SNMP port value: default ESB SNMP value 9161
If Cacti can contact newly added SNMP client device (ESB server) you should be able to.Once you have created the device it will be appeared in the device list in devices page
Creating new data source
- Click ‘console’ tab.
- Click on ‘data sources’ listed under Management section
- Click Add button in the data sources page.
- Fill following fields and click create button to create new datasource.
- Selected Data Template - SNMP - Generic OID Template
- Host - Created devices will be appeared here and select that host. (Ex: ESB (127.0.0.1)
5. Same page will be refreshed with some additional fields to be filled. Fill those fields with following values and click save button to complete Data source creation
- Data Source Fields
- Name - Suitable name for the OID which is monitored in this data source
- Data Source Item Fields [snmp_oid]
- Maximum Value - The maximum value of data that is allowed to be collected
Important : If this value is smaller than data stat value, those data points will not be added to records. You can look at Cacti Log to estimate the maximum value which should be set.
- Click on ‘console’ tab.
- Click on System Utilities button under Utilities section.
You can observe output values for the specific OID in this log. Use set of values to estimate the maximum value.
Note: We you start up WSO2 ESB server you can see the list of OIDs in debug logs. Please choose one OID for a data source. That is the OID which we are going to use for collecting stats.
SNMPAgent Registering org.apache.synapse:Type=Transport,Name=passthru-https-sender@ActiveThreadCount as OID: 1.3.6.1.4.1.18060.14.2.18.1.0
SNMPAgent Registering org.apache.synapse:Type=Transport,Name=passthru-https-sender@AvgSizeReceived as OID: 1.3.6.1.4.1.18060.14.2.18.2.0
SNMPAgent Registering org.apache.synapse:Type=Transport,Name=passthru-https-sender@AvgSizeSent as OID: 1.3.6.1.4.1.18060.14.2.18.3.0
SNMPAgent Registering org.apache.synapse:Type=Transport,Name=passthru-https-sender@BytesReceived as OID: 1.3.6.1.4.1.18060.14.2.18.4.0
………………………………....
|
Adding graph node
- Click on ‘Graph Management’ under ‘Management’ section in ‘console’ tab
- You can see existing graph nodes in this page. Click ‘Add’ button to add new graph node.
- Fill following fields and click create button
- Selected Graph Template - SNMP - Generic OID Template
- Host - Device name which has been added to be monitored
4. Once you create the graph , following page will be displayed. Fill fields providing more configurations of the graph node. You have to provide the intended data source to be monitored in ‘Data Source[ snmp-oid] field.
5. Finally click on save button to save graph node configurations.
You can create data source and graph node for each OID which should be monitored using Cacti.
Displaying graphs
- Click on ‘graphs’ tab and expand ‘Default tree’
- Click on the device which is to be monitored (ex: Host:ESB) and all graph nodes that has been created under that device will be displayed.
Note: Cacti will take approximately 15 minutes to start displaying data on newly created graph nodes.
Troubleshooting
If you are not getting any data on graphs (even after considerable time), recheck and configure data source using rrdtool
- Go to folder location where all data files are stored
cd /var/lib/cacti/ rra/
|
(You can view corresponding data file using following command)
rrdtool fetch esb_snmp_oid_9.rrd AVERAGE
|
- Check datasource configurations using following command
rrdtool info esb_snmp_oid_9.rrd
|
- Possible reason for not showing data on graphs is data source maximum value is too small. You can reconfigure corresponding data source maximum value using following command
rrdtool tune esb_snmp_oid_9.rrd --maximum snmp_oid:<maximum value>
ex: rrdtool tune esb_snmp_oid_9.rrd --maximum snmp_oid:1000000
|
No comments:
Post a Comment