This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How to save input from a custom html form to a .txt file?

FormerMember
FormerMember

Hello everybody,

i'm trying to save input from a custom html form in Solarwinds NetPerformanceMonitor into a .txt file. I wrote the code in 2 .asp files and it worked.

I added the code in a custom html template in the NetPerfMon and it is shown correctly. This is the code:

<form method="post" action="serial.asp">

Seriennummer des Zertifikats: <input type="text" size="50" name="serial" />
 
<label>Grund:

  <select name="reason">

    <option>0</option>

    <option>1</option>

    <option>2</option>

    <option>3</option>

    <option>4</option>

    <option>5</option>

    <option>6</option>

  </select>

</label>

<br><br><input type="submit" value="Zertifikat sperren"><br><br>

</form>

<!-- Green HR --><Table Border=0 CellSpacing=0 CellPadding=0 Width=100%><TR><TD BgColor=#008080><Img Src="certspc.gif" Alt="" Height=2 Width=1></TD></TR></Table>

<br><B>Gründe für die Sperrung:</B><br><br>

<table>
  <colgroup>
    <col width="40">
    <col width="250">
  </colgroup>
  <tr>
    <td>0</th>
    <td>Nicht angegeben</th>
  </tr>
  <tr>
    <td>1</th>
    <td>Schlüsselkompromittierung</th>
  </tr>
  <tr>
    <td>2</th>
    <td>Kompromittierung der Zertifizierungsstelle</th>
  </tr>
  <tr>
    <td>3</th>
    <td>Zuordnung geändert</th>
  </tr>
  <tr>
    <td>4</th>
    <td>Abgelöst</th>
  </tr>
  <tr>
    <td>5</th>
    <td>Ende des Vorgangs</th>
  </tr>
  <tr>
    <td>6</th>
    <td>Zertifikat blockiert</th>
  </tr>
</table>

The code for the "serial.asp" that should save the input into a txt file looks like this:

<%
Dim serial, reason
serial = Request.form("serial")
reason = Request.form("reason")

dim fs,f

set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile("d:\revoke\serial.txt",8,true)

f.WriteLine(serial & ";" & reason)
f.Close
set f=nothing
set fs=nothing

%>

The question is, is it possible to do this in Solarwinds and if so, what am i doing wrong, because there is no txt file created.

Thanks for help!

P.S. I added a pic from the NetPerfMon Panel.

Parents
  • This isn't so much of an NPM question as an ASP question.  When I ran into this in the past (and it's been a long time since I wrote something like this), my issue was always with permissions.  Whatever user the website is using to run (I think it's normally "NETWORK SERVICE") needs to have full permissions to that physical location on the server.  It's hard to troubleshoot this without actually writing this in my own environment.

Reply
  • This isn't so much of an NPM question as an ASP question.  When I ran into this in the past (and it's been a long time since I wrote something like this), my issue was always with permissions.  Whatever user the website is using to run (I think it's normally "NETWORK SERVICE") needs to have full permissions to that physical location on the server.  It's hard to troubleshoot this without actually writing this in my own environment.

Children
No Data