APG

From SMARTS-WIKI
Jump to: navigation, search


A collection of possibly useful things one might use with APG by Watch4Net.

Contents

Database Lookups

You will have to 1st log onto the mysql database (yourDB, health, master, topology)

Find available properties for that database

desc data_property_flat;

Show data in the property (in this case the Mask property)

desc data_property_flat;



Testing for Port on Linux

lsof -i :2003
  Provides the process ID of the port in use (2003 in this case)
ps -ef |grep 758 
  Provides the application running the that process ID



How to Find Database Size (for licensing)

SELECT CONCAT(FORMAT(SUM(DATA_LENGTH + INDEX_LENGTH)/ POWER(1024,2),2), ' Mb') AS `Size` 
   FROM information_schema.TABLES WHERE TABLES.TABLE_TYPE = 'BASE TABLE';

This should be all on 1 line



APG Commands

Web Links

http://apg.domain.com:58080/APG

http://apg.domain.com:58080/APG-RPE

Show Status of All Services

bin/manage-modules.sh service status ALL

Stop All Services

bin/manage-modules.sh service stop ALL

Start All Services

bin/manage-modules.sh service start ALL

Restart All Services

bin/manage-modules.sh service restart ALL


Reconfigure Default Datastore for a module

bin/manage-modules.sh update cisco-voip-collector Default

Show Installed Services

bin/manage-modules.sh list installed ALL

Install a Service

bin/manage-modules.sh install transaction-collector

 As an example of installing Transactions Collector


Check on Licenses

bin/manage-licenses.sh check

Install Licenses

bin/manage-licenses.sh install LicenseFileName

MySQL Restart - Stop - Start

bin/manage-modules.sh service restart mysql

bin/manage-modules.sh service stop mysql

bin/manage-modules.sh service start mysql

Tomcat Restart - Stop - Start

bin/manage-modules.sh service restart tomcat

bin/manage-modules.sh service stop tomcat

bin/manage-modules.sh service start tomcat

Logs found in

Alerting-backend /apps/APG/Backends/Alerting-Backend/Default/logs/

Collector-manager /apps/APG/>Collecting/Collector-Manager/Default/logs/

Datastore </apps/APG/Databases/APG-Datastore/Default/data/bh.err

Event-processing-manager /apps/APG/Event-Processing/Event-Processing-Manager/Default/logs/

Tomcat /apps/APG/Web-Servers/Tomcat/Default/logs/

Mysql /apps/APG/Databases/MySQL/Default/logs/apg-mysql-default.out

Check an XML file for proper formation

--noout allows you to see just the errors and not the entire file

/usr/bin/xmllint --noout fileName.xml


Change Tomcat Service connections

vi Web-Servers/Tomcat/Default/conf/server.xml


DataStore Access

Databases/APG-Datastore/Default/bin/datastore-client.sh


SMARTS Events Element Names

To get the current list of ElementClassName from the Datastore not MySQL

 ./datastore-client.sh
Enter username: [apg]
Enter database: [events]
Enter password:
mysql> SELECT DISTINCT elementClassName FROM events_archive;
+----------------------------+
| elementClassName           |
+----------------------------+
| Host                       |
|                            |
| Switch                     |
| CallManager                |
| IPPhoneGroup               |
| IP                         |
| HSRPGroup                  |
| Node                       |
| NetworkConnection          |
| VoipPerformanceManager     |
| Router                     |
| CallManagerRedundancyGroup |
| TrunkCable                 |
| GatewayService             |
| VoipCluster                |
| VoiceMailService           |
| VoipProcess                |
| VoipApplication            |
| CallProcessor              |
| VoiceMailApplication       |
| Firewall                   |
| Session                    |
| Cable                      |
| Card                       |
| CTIService                 |
| VoipNetworkService         |
| MediaGateway               |
| InChargeService            |
| Partition                  |
| Probe                      |
| MediaService               |
| SNMPAgent                  |
| VoipElement                |
| FileServer                 |
| VRF                        |
| LoadBalancer               |
+----------------------------+



Refresh APG properties

1. Restart the collector service

2. Wait 5 minutes

3. Run the telnet command

telnet localhost 2001

COMMITALL
  Wait for OK
Ctrl ]
quit

4. /apps/APG/bin/recreate-data-property.sh

5. Restart the Tomcat Service to clean the cache

MySQL Privledges view and Grant commands

Databases/MySQL/Default/bin/mysql --defaults-file="/apps/APG/Databases/MySQL/Default/my.cnf" -u root -p mysql
select user, host, db, select_priv, insert_priv, grant_priv from mysql.db;
GRANT ALL ON flow.* TO 'apg'@'apg.domain.comg' IDENTIFIED BY 'watch4net';
GRANT ALL PRIVILEGES ON events.* TO apg@'apg.domain.com' IDENTIFIED BY 'watch4net';
GRANT ALL PRIVILEGES ON apg.* TO apg@'apg.domain.com' IDENTIFIED BY 'watch4net';
GRANT ALL PRIVILEGES ON master.* TO apg@'apg.domain.com' IDENTIFIED BY 'watch4net';
GRANT ALL PRIVILEGES ON topology.* TO apg@'apg.domain.com' IDENTIFIED BY 'watch4net';


Delete Privileges from MySQL database

delete from mysql.user where host='apg.domain.com';
flush privleges;

MySQL Table Commands

DROP TABLE xxxxx;
SHOW TABLES;
SHOW TABLE STATUS;
SELECT * FROM xxxxx;
check table data_variable;
repair table data_variable;
check table data_property;
repair table data_property;

Polling Group Tests

To check if a poll group is collecting data, click on search (top right corner) and filter on source AND pollgrp where source is the name of your SNMP collector and pollgrp is the name of the poll group you want to check and expand on device (or ip). If your polling group is working properly, you should see some data.

To look at SNMP Poller Data connect yourself directly to MySql database and run a command to display all the records with pollgrp='YOUR POLLING GROUP'

SELECT * FROM data_property_flat WHERE source='name of your source' AND pollgrp='your polling group';

This command should return some values if the group is polling. If you want to see the raw data polled by this group, select any ID (in the ID field of the output of the query above) and run the following command:

SELECT * FROM cache_group_* WHERE variable='the id you have picked up from the query above';

Replace the * with the name of the table you want to poll (an example cache_group_0_1314122400 if you want to check all the values that have been collected since 1314122400 (UNIX time))

File-Connector Troubleshooting Tool Enable the file-connector in collecting.xml. This file-connector will display t he values live as they are collected from the devices. If you don't see any entry that belongs to your Polling group, it means that the group is not collecting any data.

vim Collecting/Collector-Manager/Default/conf/collecting.xml

/apps/APG/Collecting/Collector-Manager/Default/logs/file-connector

Just open file-connector.log and search for all the occurrence containing the name of your polling group. You will see all the properties and all the metrics collected by the SNMP agent for that group. NOTE: Be careful, this file might be very big and eats lot of disk space. Disable it from the collecting.xml once done testing and delete the file-connector under logs to free up some space.


MySQL Data Wipe

Deleting the folder /apps/APG/Databases/MySQL/Default/data/apg and its content will delete all collected data. It's like dropping the whole apg database.

Before restarting all services:

a) start up MySQL service ONLY!
b) Connect to MySQL using /apps/APG/bin/mysql-client.sh
c) Make sure the apg database exists with this command: show databases;  
    in mysql-client.sh, end all commands with a semi-colon
d) If the apg database does not exist, recreate it with this command: CREATE DATABASE apg;
e) Launch the Backend service and let it go for 2-3 minutes so it creates the tables in APG
f) Watch the Backend's log to see if it can connect to the apg database
g) Verify the existence of 2 tables in the apg database with this MySQL command:
   SHOW TABLES;
h) Launch other APG services, including the collectors.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox