0

I need a suggestion on how to make this to work.

We have a print server which has some "pcl to pdf" converter application that listens on port 9001, collects PCL jobs and creates PDF from PCL. The problem is that pcl to pdf application does not support SNMP. As all this happens in citrix environment citrix uses snmp protocol to query printer status. We can't disable SNMP in citrix because of an IT restriction. Because of all that printer is reported as offline for all users and it can't be used.

When we put packet capture on our machine we see some printer traps/oids:

1.3.6.1.2.1.25.3.2.1.5.1

1.3.6.1.2.1.25.3.5.1.1.1

1.3.6.1.2.1.25.3.5.1.2.1

If we could somehow simulate printer responses for snmp queries on above OIDs that would solve our issue.

Any suggestions?

HABJAN
  • 51
  • 4
  • Does the printer show as Online or Offline from the Print Server itself? This doesn't sound like a Citrix related issue at all, so what happens on another server that can see the printer? What Operating Systems are involved? – Dan Feb 13 '12 at 13:34
  • The thing is that application is listening printer port 9001, and it does only that. The application simulates printer and it does not support SNMP. So, there is no actually printer installed in printers and devices on the print server. We believe the operating system is Windows 2000. Unfortuately we do not have access to the servers and our client does not want to approach the IT vendor. But have to provide a client print solution. – HABJAN Feb 13 '12 at 14:00
  • This makes no sense - if it's simulating a printer, then there must be something installed in Printers & Devices. This concept isn't new, but this does sound like an issue with the software. – Dan Feb 13 '12 at 14:16
  • Here you can find more about software we use (Brooks Net RPM): http://www.brooksnet.com/ – HABJAN Feb 13 '12 at 14:47
  • A (little complicated) idea: Set up a linux box as a private firewall to the print server. Configure it with the printer server's IP, give the print server a private IP. Do a DNAT configuration (with iptables, the PS has the linux box as default route) from the linux box to the PS on Port 9001. The SNMP port on the linux port is proxied to an existing working printer (with this: http://www.net-snmp.org/wiki/index.php/Snmpd_proxy). Voila! the only problem would be that the PS won't work if the proxies printer is unavailable. – AndreasM Feb 14 '12 at 12:49
  • @AndreasM Sounds like the answer I was about to give. So make it one and get the bounty. ;-) – Nils Feb 15 '12 at 21:05
  • I found simpler solution, check last answer. Thank you all for trying to help. – HABJAN Feb 17 '12 at 09:50

1 Answers1

0

I managed to find a solution for my problem.

I downloaded #SNMP (C# Based Open Source SNMP) which contains SNMPD project ( SNMP Agent ) and then i wrote a couple of classes that handles OID's that i had to respond to.

Based on: http://www.oid-info.com/get/1.3.6.1.2.1.25.3.2.1.5

public class hrDeviceStatus : ScalarObject
{
    private readonly Integer32 _value = new Integer32(2); // running 2

    public hrDeviceStatus()
        : base(new ObjectIdentifier("1.3.6.1.2.1.25.3.2.1.5.1"))
    {
    }

    public override ISnmpData Data
    {
        get 
        {
            return _value; 
        }
        set {  }
    }
}

Based on: http://www.oid-info.com/get/1.3.6.1.2.1.25.3.5.1.1

public class hrPrinterStatus : ScalarObject
{
    private readonly Integer32 _value = new Integer32(1); // other

    public hrPrinterStatus()
        : base(new ObjectIdentifier("1.3.6.1.2.1.25.3.5.1.1.1"))
    {
    }

    public override ISnmpData Data
    {
        get 
            { 
                return _value; 
            }
        set { }
    }
}

Based on: http://www.oid-info.com/get/1.3.6.1.2.1.25.3.5.1.2

public class hrPrinterDetectedErrorState : ScalarObject
{
    private readonly OctetString _value = new OctetString("\0\0"); // all 16 bits set to 0 

    public hrPrinterDetectedErrorState()
        : base(new ObjectIdentifier("1.3.6.1.2.1.25.3.5.1.2.1"))
    {
    }

    public override ISnmpData Data
    {
        get 
        { 
            return _value; 
        }
        set { }
    }
}

And then i added them to the object store.

    var store = Container.Resolve<ObjectStore>();
    store.Add(new hrDeviceStatus());
    store.Add(new hrPrinterStatus());
    store.Add(new hrPrinterDetectedErrorState());

That's all. Thanks everyone that tried to help.

HABJAN
  • 51
  • 4