Ad Widget

Collapse

monitor cpu utilization via ssh agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shakman
    Junior Member
    • Dec 2012
    • 3

    #1

    monitor cpu utilization via ssh agent

    I'm trying to monitor a set of systems where installing the agent is not an option (long story, don't ask.) I have successfully setup other monitors to report back on filesystem usage, memory utilization, etc., but for some odd reason, I absolutely cannot get good CPU utilization data back from the target systems. I'm trying to pump this command to the target via the SSH Agent:

    Code:
    iostat -c | sed -n '4p' | awk {'print $6'}
    Running this manually via command-line ssh, it works great and gives me exactly what I want. However, when I put this into the item configuration, it gives me nothing. Just for kicks and grins and to confirm I'm not mad, I changed the command to be:

    Code:
    iostat -c | sed -n '4p' | awk {'print $6'} > /tmp/idlecpu;cat /tmp/idlecpu
    I'm at a loss. Any help is greatly appreciated.
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    Do you already have inspected the log file for errors?

    Comment

    • shakman
      Junior Member
      • Dec 2012
      • 3

      #3
      Yes, I checked the log and turned on debugging for the server. The only indication of a problem I'm getting is a "1" return code from the ssh session. Not especially helpful.

      Comment

      • BDiE8VNy
        Senior Member
        • Apr 2010
        • 680

        #4
        what happens if you try:
        Code:
        iostat -c | sed -n '4p' | awk '{print $6}'
        or:
        Code:
        iostat -c | sed -n '4p' | awk '{print $$6}'
        or:
        Code:
        iostat -c | sed -n '4p' | wc -l
        or:
        Code:
        echo 42
        Last edited by BDiE8VNy; 17-12-2012, 21:45. Reason: Addition

        Comment

        • shakman
          Junior Member
          • Dec 2012
          • 3

          #5
          I *FINALLY* convinced the system owners to go with SNMP monitoring. I'm getting what I need now.

          Thanks.

          Comment

          • aouaneaomar
            Junior Member
            • Apr 2013
            • 1

            #6
            Originally posted by shakman
            I *FINALLY* convinced the system owners to go with SNMP monitoring. I'm getting what I need now.

            Thanks.
            Hi Shakman,

            Please could y
            ou share how did you manage to get all the information (Memory, cpu...) using snmp?

            I am in the process trying to get the same information and it getting complicated.
            I have created a small program with JAVA and I could get access to any router via their IP address and I did manage to get information from the router such as NAME, TIME-UP, Object

            I would really appreciate if any one can tell me how I monitory every interface in the router if that possible?

            what OID I should use?
            how i should configure the router to give me such information?

            Many thanks

            Aomar

            Comment

            Working...