• Forums
    • Public Forums
      • Community Connect
      • Dynatrace
        • Dynatrace Open Q&A
      • Application Monitoring & UEM
        • AppMon & UEM Open Q&A
      • Network Application Monitoring
        • NAM Open Q&A
  • Home
  • Public Forums
  • Application Monitoring & UEM
  • AppMon & UEM Open Q&A
avatar image
Question by Kim S. · Mar 11, 2014 at 09:36 AM · plugins

How to get an agent names through a Plug-In from incidents

Customer wants to make a plug-in which is taken agent names from incidents on DT.

There is usually shown agent name from incidents, here they tried to get it though Plug-In, however, they could not get agent names even though they could get some messages through Plug-In from incidents.

If they want make a Plug-in which is able to get agent names from incidents defined, how they can get agent names from incidents ?

they expect to have 20 incidents to be defined for 56 JVMs and 14 web servers

Below is their source ;

 

public Status execute(ActionEnvironment env) throws Exception {

Status status = new Status();

LogFileWriter writer;

 

if(isSMB) {

writer = new LogFileWriter(folder, fileName, user_name, password);

}else {

writer = new LogFileWriter(folder, fileName);

}

 

Collection<Incident> incidents = env.getIncidents();

for (Incident incident : incidents) {

String message = incident.getMessage();

String time = incident.getStartTime().toString();

String profileStr = incident.getKey().toString();

String matcher = "systemProfile=";

 

 

int firstInt = profileStr.indexOf(matcher);

int endInt = profileStr.indexOf("]");

 

String proFile;

 

proFile = profileStr.substring(firstInt + matcher.length(),endInt);

 

status = writer.writeLog(message, changeFormat(time), log1, proFile, incidentLevel.substring(0, 1));

 

log.log(Level.INFO, "Host = " + env.getHost());

log.log(Level.INFO, "System Profile = " + env.getSystemProfileName());

 

log.log(Level.INFO, "Message = " + message);

log.log(Level.INFO, "Start Time = " + time);

log.log(Level.INFO, "Profile = " + proFile);

 

Collection<PurePath> purepaths = incident.getPurePaths();

for(PurePath purePath : purepaths) {

log.log(Level.INFO, "Agent ID = " + purePath.getAgentId());

}

}

 

return status;

}

Comment

People who like this

0 Show 0
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

1 Reply

  • Sort: 
  • Most voted
  • Newest
  • Oldest
avatar image

Answer by Eugene T. · Mar 11, 2014 at 11:53 AM

Hi Sanghyun,

The com.dynatrace.diagnostics.pdk.Incident interface contains Collection of violations referenced by the Incident.getViolations() method. Each com.dynatrace.diagnostics.pdk.Violation, i.e. each object which implements the com.dynatrace.diagnostics.pdk.Violation, contains reference to the com.dynatrace.diagnostics.pdk.Source of violation. Object which implements the com.dynatrace.diagnostics.pdk.Source interface can be one of the following 5 types:

  1. com.dynatrace.diagnostics.pdk.AgentSource;
  2. com.dynatrace.diagnostics.pdk.AgentGroupSource;
  3. com.dynatrace.diagnostics.pdk.MonitorSource;
  4. com.dynatrace.diagnostics.pdk.CollectorSource;
  5. com.dynatrace.diagnostics.pdk.ServerSource.

The com.dynatrace.diagnostics.pdk.AgentSource.getName() method returns name of the agent which is a source of the violation that triggered incident.

Please let me know if you have any further questions.

Eugene.

Comment

People who like this

0 Show 0 · Share
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

How to get started

First steps in the forum
Read Community User Guide
Best practices of using forum

NAM 2019 SP5 is available


Check the RHEL support added in the latest NAM service pack.

Learn more

LIVE WEBINAR

"Performance Clinic - Monitoring as a Self Service with Dynatrace"


JANUARY 15, 3:00 PM GMT / 10:00 AM ET

Register here

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Real time BT feeds data - Flume to mongo

VMware Monitors for Hosts / Guest machines

Data of performance warehouse - Any documentation about the data?

Generic Execution Plugin: Problem with quoting of spaces

Could you please provide details on how to integate Dynatrace with the Jenkins pipeline. In particular running Jmeter tests

Forum Tags

dotnet mobile monitoring load iis 6.5 kubernetes mainframe rest api dashboard framework 7.0 appmon 7 health monitoring adk log monitoring services auto-detection uem webserver test automation license web performance monitoring ios nam probe collector migration mq web services knowledge sharing reports window java hybris javascript appmon sensors good to know extensions search 6.3+ server documentation easytravel web dashboard kibana system profile purelytics docker splunk 6.1 process groups account 7.2 rest dynatrace saas spa guardian appmon administration production user actions postgresql upgrade oneagent measures security Dynatrace Managed transactionflow technologies diagnostics user session monitoring unique users continuous delivery sharing configuration alerting NGINX splitting business transaction client 6.3 installation database scheduler apache mobileapp RUM php dashlet azure purepath agent 7.1 appmonsaas messagebroker nodejs 6.2 android sensor performance warehouse
  • Forums
  • Public Forums
    • Community Connect
    • Dynatrace
      • Dynatrace Open Q&A
    • Application Monitoring & UEM
      • AppMon & UEM Open Q&A
    • Network Application Monitoring
      • NAM Open Q&A