Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The extension cannot start #5

Open
duy-nguyen-devops opened this issue Jun 1, 2022 · 0 comments
Open

The extension cannot start #5

duy-nguyen-devops opened this issue Jun 1, 2022 · 0 comments

Comments

@duy-nguyen-devops
Copy link

The error log is here

ip-172-20-1-213==> [Agent-Monitor-Scheduler-2] 01 Jun 2022 11:43:29,617 ERROR PeriodicTaskRunner - Error creating environment task
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Map (java.lang.String and java.util.Map are in module java.base of loader 'bootstrap')
	at com.appdynamics.extensions.network.NetworkMonitor.getServers(NetworkMonitor.java:54) ~[?:?]
	at com.appdynamics.extensions.AMonitorJob.run(AMonitorJob.java:47) ~[?:?]
	at com.appdynamics.extensions.ABaseMonitor.executeMonitor(ABaseMonitor.java:199) ~[?:?]
	at com.appdynamics.extensions.ABaseMonitor.execute(ABaseMonitor.java:187) ~[?:?]
	at com.singularity.ee.agent.systemagent.components.monitormanager.managed.MonitorTaskRunner.runTask(MonitorTaskRunner.java:149) ~[machineagent.jar:Machine Agent v22.4.0-3344 GA compatible with 4.4.1.0 Build Date 2022-04-26 16:17:31]
	at com.singularity.ee.agent.systemagent.components.monitormanager.managed.PeriodicTaskRunner.runTask(PeriodicTaskRunner.java:86) ~[machineagent.jar:Machine Agent v22.4.0-3344 GA compatible with 4.4.1.0 Build Date 2022-04-26 16:17:31]
	at com.singularity.ee.agent.systemagent.components.monitormanager.managed.PeriodicTaskRunner.run(PeriodicTaskRunner.java:47) [machineagent.jar:Machine Agent v22.4.0-3344 GA compatible with 4.4.1.0 Build Date 2022-04-26 16:17:31]
	at com.singularity.ee.util.javaspecific.scheduler.AgentScheduledExecutorServiceImpl$SafeRunnable.run(AgentScheduledExecutorServiceImpl.java:122) [agent-22.5.0-415.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at com.singularity.ee.util.javaspecific.scheduler.ADFutureTask$Sync.innerRunAndReset(ADFutureTask.java:335) [agent-22.5.0-415.jar:?]
	at com.singularity.ee.util.javaspecific.scheduler.ADFutureTask.runAndReset(ADFutureTask.java:152) [agent-22.5.0-415.jar:?]
	at com.singularity.ee.util.javaspecific.scheduler.ADScheduledThreadPoolExecutor$ADScheduledFutureTask.access$101(ADScheduledThreadPoolExecutor.java:119) [agent-22.5.0-415.jar:?]
	at com.singularity.ee.util.javaspecific.scheduler.ADScheduledThreadPoolExecutor$ADScheduledFutureTask.runPeriodic(ADScheduledThreadPoolExecutor.java:206) [agent-22.5.0-415.jar:?]
	at com.singularity.ee.util.javaspecific.scheduler.ADScheduledThreadPoolExecutor$ADScheduledFutureTask.run(ADScheduledThreadPoolExecutor.java:236) [agent-22.5.0-415.jar:?]
	at com.singularity.ee.util.javaspecific.scheduler.ADThreadPoolExecutor$Worker.runTask(ADThreadPoolExecutor.java:694) [agent-22.5.0-415.jar:?]
	at com.singularity.ee.util.javaspecific.scheduler.ADThreadPoolExecutor$Worker.run(ADThreadPoolExecutor.java:726) [agent-22.5.0-415.jar:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

My config.yml

# Use the following metricPrefix if SIM is enabled.
# metricPrefix: "Server|Component:<COMPONENT_ID>|Custom Metrics|Network|"
# Use the following metricPrefix if SIM is not enabled.
metricPrefix: "Custom Metrics|Network|"

# In case of linux, networkInterface names are of the form eth*
# In Windows, please use the network full name from Device Manager
networkInterfaces: [ "eth0" ]

overrideMetricsUsingScriptFile: false

scriptTimeoutInSec: 60

scriptFiles:
  - osType: windows
    filePath: monitors/NetworkMonitor/scripts/windows-metrics.bat
  - osType: unixBase
    filePath: monitors/NetworkMonitor/scripts/unix-base-metrics.sh

numberOfThreads: 2

# Default information needs to be updated
controllerInfo:
  controllerHost: "controller"
  controllerPort: 8080
  account: "customer1"
  username: "user1"
  password: "welcome"
  encryptedPassword: ""
  controllerSslEnabled: false
  enableOrchestration: false
  uniqueHostId: ""
  accountAccessKey: ""
  machinePath: ""
  simEnabled: true
  applicationName: ""
  tierName: ""
  nodeName: ""

encryptionKey: ""

I found that in code error with this line at https://github.com/Appdynamics/network-monitoring-extension/blob/master/src/main/java/com/appdynamics/extensions/network/NetworkMonitor.java

50	@Override
51	protected List<Map<String, ?>> getServers() {
52		List<Map<String, ?>> networkInterfaces = (List<Map<String, ?>>) getContextConfiguration().getConfigYml().get("networkInterfaces");
53		List<Map<String, ?>> anInterface = new ArrayList<>();
54		anInterface.add(networkInterfaces.get(0)); # <-- ERROR THIS LINE
55		AssertUtils.assertNotNull(anInterface, "The 'networkInterfaces' section in config.yml is not configured");
56		return anInterface;
57	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant