<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hmm, okay. What you are saying makes
      sense. <br>
      <br>
      I'm actually wondering if it might be more beneficial for me to
      check if the local DHCP port (udp 67) is bound and in use. I had
      tried to do this some time ago, and couldn't get it working right
      (it would always test true, even when it shouldn't have). Can
      anyone steer me in the right direction on port status?<br>
      <br>
      <div class="moz-signature">
        <div style="font-family: sans-serif; font-size: 10pt;
          margin-bottom: 20px;">
          <div style="font-size: 14pt; font-weight: bold; color:
            #A70000; margin-bottom: 5px; letter-spacing: -1px;">Jason
            Bailey</div>
          <div style="font-style: italic; font-weight: bold;">Network
            Technician</div>
          <div style="font-style: italic; font-weight: bold;">Emery
            Telcom</div>
          <div style="font-style: italic;">Office: (435) 636-0052</div>
          <div style="font-style: italic; color: #A70000"><a class="moz-txt-link-abbreviated" href="mailto:JBailey@emerytelcom.com">JBailey@emerytelcom.com</a></div>
        </div>
        <br>
      </div>
      On 01/21/2015 09:39 PM, Chris Angelico wrote:<br>
    </div>
    <blockquote
cite="mid:CAPTjJmrpjdNBf4C79gj2BB5S4+QhtDz0_LPcrn2J8-gVUY4T6g@mail.gmail.com"
      type="cite">
      <pre wrap="">On Thu, Jan 22, 2015 at 2:58 PM, Jason Bailey <a class="moz-txt-link-rfc2396E" href="mailto:JBailey@emerytelcom.com"><JBailey@emerytelcom.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">How would I get a list of running processes with the subprocess module? The
documentation wasn't clear to me.
</pre>
      </blockquote>
      <pre wrap="">
Using the ps command. :)

rosuav@dewey:~$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">import subprocess
b" dhcpd\n" in subprocess.check_output(["ps","-A"])
</pre>
          </blockquote>
        </blockquote>
      </blockquote>
      <pre wrap="">False

rosuav@sikorsky:~$ python3
Python 3.5.0a0 (default:4709290253e3, Jan 20 2015, 21:48:07)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">import subprocess
b" dhcpd\n" in subprocess.check_output(["ps","-A"])
</pre>
          </blockquote>
        </blockquote>
      </blockquote>
      <pre wrap="">True

There's a DHCP server running on Sikorsky, but not on Dewey. :)

Of course, this can be faked. Any process can call itself 'dhcpd' and
pretend to be the DHCP server. It's up to you to decide how to deal
with that. (Probably by not caring, I would expect. Unless you
actually expect someone to maliciously try to confuse your script,
it's not worth the hassle of protecting yourself.)

ChrisA
</pre>
    </blockquote>
    <br>
  </body>
</html>