VMware Cloud Community
baber
Expert
Expert

How can add monitor script for linux on vrops

Dear all

Hi

i have installed endpoint operation agent on my linux server and now that server can be monitor in vrops in operation system world i want use add monitor script but 2 problem:

1- how can i  check a service on my linux server is up or down for example i want check iptables is up or down how do i have to write that?? In redhat i write service iptables status in linux script how do i have to write??

2- what does path means in add monitor script??

now

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
14 Replies
sxnxr
Commander
Commander

again as answered in one of you many other posts have you tried

https://thecloudxpert.net/2016/04/howto-monitor-a-process-in-linux-using-vrealize-operations-endpoin...

Doing this will not require a script

0 Kudos
baber
Expert
Expert

thanks i read that but please see my attach pic in attach pic the out put of ps -ef | grep java  show node1 , node2 , node3 , node default now how can define these in vrops that can check these nodes if one of them has been down it show critical can it do that ???

BR

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
sxnxr
Commander
Commander

i dont see an image

0 Kudos
baber
Expert
Expert

excuseme attached pic

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
sxnxr
Commander
Commander

You would run the second command for each of of the Pids you want to monitor from the output of the first

0 Kudos
baber
Expert
Expert

but every time the service or process will be kill and will be start the process id will be change

the process id for a service on linux is not stable it will be change with every stop/start service thus monitor service with process id is not usefull

is that correct ????

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
sxnxr
Commander
Commander

you are not monitoring the PID you are monitoring the name. You just use the command to get the pid of the current running process to then get the name

If you read the full thing the second command which is an eops command will get the name of the process that you will add to the end of State.Name.eq=

0 Kudos
baber
Expert
Expert

ok

please see previous attached pic in attached pic we have 2 node2 with difference pids one of them is for a module with DM and the other is for other module TF now how define node2 for DM is up or node2 for TF is up ??

BR

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
sxnxr
Commander
Commander

Answer the below

  1. What is the PID for the TF Node
  2. What is the PID for DM Node
  3. Have you run the second command for the above two PIDS and gotten the name of the process
  4. Are the process names different after running question 3 for the pids in question 1 and 2
0 Kudos
baber
Expert
Expert

PID for TF node1 is :24423

PID for TF node2 is :24451

PID for TF default is :24511

---------------------

PID for DM node1 is :24149

PID for DM node2 is :24180

PID for DM node3 is :24225

PID for DM default is :24256

i have a jboss service on my server but run 2 jboss on my server one of them controll DM and one of them controll TF

for run DM go to this path

/usr/local/jboss-4.0.2-DM/bin

and run these commands :

./run.sh -c node1

./run.sh -c node2

./run.sh -c node3

and for TF go to this path

/usr/local/jboss-4.0.2-TF/bin

and TF after cd to dir

type this :

./run.sh -c node1

./run.sh -c node2

BR

Babak

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
sxnxr
Commander
Commander

did you run java -jar /opt/vmware/epops-agent/bundles/agent-x86-64-linux-6.2.0/pdk/lib/sigar-1.6.6.13.jar

NOTE: change the folder for agent-x86-64-linux-6.2.0 in the above to you version on the agent and make sure igar-1.6.6.13.jar is alos correct

At the Sigar shell type pinfo 24423

Make a note of the Name=

and repeated for all the pids

If they are all different names then create a process monitor for each on in vrops

0 Kudos
baber
Expert
Expert

3 question :

1 - we just want use pinfo for find the name of service?

2 - this is my output

[root@aml bin]# java -jar /opt/vmware/epops-agent/bundles/agent-x86-64-linux-6.5.0/pdk/lib/sigar-1.6.6.13.jar

sigar> pinfo 17372

pid=17372

state={Name=java, Threads=44, Tty=34816, State=S, Ppid=17319, Processor=2, Priority=20, Nice=0}

mem={Resident=579166208, PageFaults=92128, MajorFaults=257, Share=20480000, MinorFaults=91871, Size=4962926592}

cpu={User=16460, LastTime=1502136699361, Percent=0.0, StartTime=1502136581000, Total=17650, Sys=1190}

cred={Euid=0, Gid=0, Egid=0, Uid=0}

credname={User=root, Group=root}

diskio={BytesWritten=0, BytesTotal=0, BytesRead=0}

cumulative diskio={BytesWritten=25915392, BytesTotal=109363200, BytesRead=83447808}

but problem is Name=java appear but if i type State.Name.eq=java

it won't work correctly because there are many java on my server each of node will be show with name=java and this is a problem

3 - i have the other server that oracle has been installed on that for start this service i have to type below commands:

.ias.env

opmnctl startall

and when type opmnctl status if all of service has been up attached pic will be show

now how can these in vrops ??

BR

Babak

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
baber
Expert
Expert

please help me for solve the problem

BR

Please mark helpful or correct if my answer resolved your issue.
0 Kudos
sxnxr
Commander
Commander

I cant help any more as i dont have a linux VM with the eops agent on it.

The only thing i can suggest that was suggested in another post is to upgrade your agent to 6.6

0 Kudos