I need to monitor a Java process using SNMP i.e if the Java process is down it should send a Trap . Need help in how to use net-snmp to monitor the java process
My queries are for net-snmp:
Do I have to create a MIB for my Java process?
How does the SNMP agent receive the status? Does it runs some script to collect the status report? Where should the script be configured?
If I have the MIB file will it be sufficient to use with the SNMP agent or I have to write some scripts also?
Java can give you SNMP information by itself. See SNMP Monitoring and Management.
You need to activate it using the "com.sun.management.snmp.port" system propertie and an ACL file.
The problem is that it will not send traps if it crashes, you can only get "live/running" information.
To monitor the java process itself (is it live or dead, send a trap when crashing) you have to use an external tool such as Net-SNMP configured with the proc directive and "DisMan Event MIB". See man pages for more information.
Related
So I was running some tests across some machines and monitoring CPU/Memory usage by process.
To test it's accuracy I was also monitoring with VisualVM.
and the graphs were off slightly.
Also on Jmeter when I monitor CPU/memory but not per process name it gives the exact same results - so it's not seeing the process.
If i do it by process ID it works - but the process ID changes so don't want to go this route.
Beside process name there is occurence , anyone know what this is and whether it can be left blank or not.
I don't think the process is called kafka, my expectation is that both for Windows or for Linux/Unix you should be looking for java process, not Kafka
So try changing the process name to java and it should start working as expected:
If it doesn't - launch PerfMon Agent with --loglevel debug parameter - it should print a lot of useful information into stdout
Just in case check out How to Monitor Your Server Health & Performance During a JMeter Load Test article for more information.
If i want to monitor processes running on windows servers, could winlogbeats be configured used to pull this type of data and send to elasticsearch for indexing ?
Process infos like Image Name, CPU time, memory, User, PID ... as seen in task manager
WinlogBeat is used primarily for shipping windows event viewer logs into elastic. If you want to monitor critical events in your system event log over multiple machines, WinlogBeat is the way to go.
For metrics, you'd be better off using the perfmon options within MetricBeat. Any metrics you can pull from perfmon (which includes everything in task manager) you can ship to elastic via MetricBeat.
https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-metricset-windows-perfmon.html
In the context of system monitoring, I need to determine which user is running a certain process on a remote machine.
As the host may be running Linux, Windows or Solaris it was decided to achieve this through SNMP queries.
The information I have so far is:
The process IDs can be queried from the OID 1.3.6.1.2.1.25.4.2.1.1,
the corresponding process names from the OID 1.3.6.1.2.1.25.4.2.1.2.
Is it possible to use this information to determine which user is running a process with some given ID?
Thanks in advance for your help.
While searching for a MIB that supports the required functionality, I came across NET-SNMP-EXTEND-MIB.
This MIB allows to extend SNMP to execute scripts.
Following this guide, allowed me to retrieve process owners by process name resp. PID for Linux OS.
However, for Windows I have not yet found a solution.
I've been given a task to write some code to notify administrators if the device sends a trap. Also I'd like to be able to check upon the device as well.
I'm not so sure where to begin. Is there a test server online where I can test if I setup the device correctly? (Whether it send traps according to the condition I set?)
If I were to write code to monitor this device, I think I should learn how the snmp and mib files work exactly. Is there good summary and reference for me?
Is there some simple example code for snmp?
download any trial based S/W to receive traps on your system like LoriotProV6 or SolarWids.
In windows based sys open run evntwin.exe n select ur preferred options to generate traps like SNMP.
Here you need to check for Trapping column if it says "Yes" then only select it..
or else it wont mean any thing.
then click add run ur SNMP services.
To rum SNMP services go to control panel-> Add/Remove -> Add/Remove Windows component -> check Management & Monitoring click on details n check SNMP & WMI options.
now go to control panel-> Administrator tools -> Services -> search SNMP services n& start it.
You can consider 2 basic ways to check whether the device of interest generating/sending out SNMP traps.
You can just run wireshark on the device (if possible) or on the target server (where the traps supposed to arrive). Then you can filter the traffic using default SNMP ports. For example it could be one of the following: 161, 162, 10161, 10162.
You can install a MIB browser on the target server and see if any traps arrive. There are number of available free applications on the web.
I want to know the following information:
For each process on the windows platform:
pid sent received
... ... ...
Are there some APIs that supply these information?
Through WMI and Windows 7, popup perfmon for a quick look. Also, consider this question:
Can I use WMI to find the network usage by each process?